Saturday, August 4, 2007

Install Ubuntu from Windows in 3 Steps without Using a CD


I can't help thinking about the days when, if you wanted to install a Linux distribution on your system, you had to go through a messy repartitioning of your hard drive, burning the distribution's image on a CD (or several CDs – there where no DVDs around those times) and, finally, figuring out what to do with the newly created CDs. If you were lucky enough you had a semi-working OS on your machine that needed numerous tweaks, fixes and other things like these until it worked fine. And I'm not talking about getting it to work exactly how you wanted it to... just getting it to work.Nowadays, installing a Linux flavored OS on your computer shouldn't be such a hard task to accomplish because there are tools out there that do it without you having to juggle around with your hard disk's partitions and even give a damn about what is happening under the hood. These days, we have come to a point when we can install Linux from inside our Windows OS by using a native Windows executable. One of the multitude of such programs is Wubi (Windows

based Ubuntu Installer), the one that I picked to present you before starting this article.
The thing that will surely amaze you is not that Wubi will install Ubuntu (with its flavors: Ubuntu, Kubuntu, Xubuntu, Edubuntu, UbuntuStudio) on your system without you having to deal with a mind-blowing row of tasks before finally having it ready to run, but that it will not affect your file system in any manner. As you can read on Wubi's FAQ page, "Wubi adds an entry to the Windows boot menu which allows you to run Linux. Ubuntu is installed within a file in the windows file system ( c:wubidiskssystem.virtual.disk ), this file is seen by Linux as a real hard disk."So, you see, nothing gets changed in your Windows OS and there is almost nothing to it. In three unbelievable easy steps, anyone – even people that have never seen the looks of a Linux OS – can install Ubuntu on their computer. What are those steps I'm talking about? Well... this is about everything you have to do:

1. Download Wubi from HERE;2. Run Wubi from Windows as you would proceed with any other Windows program;3. Select the password to be used while installing Ubuntu and click Install.And presto, you have a fast, good-looking and (I think) very easy-to-use Linux distribution running right beside Windows in a dual boot environment.The only thing that you really have to think about when beginning to install Ubuntu using Wubi is to decide how big the installation size should be. From what I've learned so far, 10 GB of space would prove more than enough for everything you might think to do when using it. But, if you think you'll need more and you have the necessary space (and I bet most of you do) you could give it about 20 GB to be sure everything will go as smooth as you'd want it to.Keep in mind though: unlike using a paid software, when using Wubi (which is a free application) there are no warranties, therefore you run Wubi at your own risk. Despite this warning coming from the program's developers, I have never heard about a case when things have gone wrong.What remains to be said now? Just enjoy Ubuntu and get back with a comment if everything is OK. If not... well... I’m impatiently waiting to hearing from you.This is Wubi in action installing Ubuntu on my PC

Friday, July 27, 2007

INSTALL: howto sudo port install db4 Successfully

As Admin: vi /opt/local/var/macports/sources/rsync.macports.org/release/ports/databases/db4/PortfileChange the line:configure.args --enable-compat185 --enable-dump185 --enable-cxx \TOconfigure.args --enable-cxx \Then: sudo port clean db4; sudo port install db4Background, for those interested:The db4 package in MacPorts is - as of this writing - broken. It fails to compile due to issues with db_dump18:> sudo port -b install db4---> Fetching db4---> Verifying checksum(s) for db4---> Extracting db4---> Applying patches to db4---> Configuring db4---> Building db4 with target allError: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_db4/work/db-4.3.29/build_unix" && make all " returned error 2Command output: ar cru .libs/libdb_tcl-4.3.a tcl_compat.o tcl_db.o tcl_db_pkg.o tcl_dbcursor.o tcl_env.o tcl_internal.o tcl_lock.o tcl_log.o tcl_mp.o tcl_rep.o tcl_seq.o tcl_txn.o tcl_util.o db185.o mut_tas.o bt_compare.o bt_conv.o bt_curadj.o bt_cursor.o bt_delete.o bt_method.o bt_open.o bt_put.o bt_rec.o bt_reclaim.o bt_recno.o bt_rsearch.o bt_search.o bt_split.o bt_stat.o bt_upgrade.o btree_auto.o hash.o hash_auto.o hash_conv.o hash_dup.o hash_meta.o hash_method.o hash_open.o hash_page.o hash_rec.o hash_reclaim.o hash_stat.o hash_upgrade.o hash_verify.o qam.o qam_auto.o qam_conv.o qam_files.o qam_method.o qam_open.o qam_rec.o qam_stat.o qam_upgrade.o qam_verify.o rep_auto.o rep_backup.o rep_method.o rep_record.o rep_region.o rep_stat.o rep_util.o db_ovfl_vrfy.o db_vrfy.o db_vrfyutil.o bt_verify.o aes_method.o crypto.o mt19937db.o rijndael-alg-fst.o rijndael-api-fst.o crdel_auto.o crdel_rec.o db.o db_am.o db_auto.o db_byteorder.o db_cam.o db_conv.o db_dispatch.o db_dup.o db_err.o db_getlong.o db_idspace.o db_iface.o db_join.o db_log2.o db_meta.o db_method.o db_open.o db_overflow.o db_pr.o db_rec.o db_reclaim.o db_rename.o db_remove.o db_ret.o db_salloc.o db_setid.o db_setlsn.o db_shash.o db_stati.o db_truncate.o db_upg.o db_upg_opd.o dbm.o dbreg.o dbreg_auto.o dbreg_rec.o dbreg_stat.o dbreg_util.o env_file.o env_method.o env_open.o env_recover.o env_region.o env_stat.o fileops_auto.o fop_basic.o fop_rec.o fop_util.o hash_func.o hmac.o hsearch.o lock.o lock_deadlock.o lock_id.o lock_list.o lock_method.o lock_region.o lock_stat.o lock_timer.o lock_util.o log.o log_archive.o log_compare.o log_get.o log_method.o log_put.o log_stat.o mp_alloc.o mp_bh.o mp_fget.o mp_fmethod.o mp_fopen.o mp_fput.o mp_fset.o mp_method.o mp_region.o mp_register.o mp_stat.o mp_sync.o mp_trickle.o mutex.o os_abs.o os_alloc.o os_clock.o os_config.o os_dir.o os_errno.o os_fid.o os_fsync.o os_handle.o os_id.o os_map.o os_method.o os_oflags.o os_open.o os_region.o os_rename.o os_root.o os_rpath.o os_rw.o os_seek.o os_sleep.o os_spin.o os_stat.o os_tmpdir.o os_truncate.o os_unlink.o sha1.o seq_stat.o sequence.o snprintf.o txn.o txn_auto.o txn_method.o txn_rec.o txn_recover.o txn_region.o txn_stat.o txn_util.o xa.o xa_db.o xa_map.oranlib: file: .libs/libdb_tcl-4.3.a(tcl_compat.o) has no symbolsranlib: file: .libs/libdb_tcl-4.3.a(tcl_lock.o) has no symbolsranlib: file: .libs/libdb_tcl-4.3.a(tcl_log.o) has no symbolsranlib: file: .libs/libdb_tcl-4.3.a(tcl_rep.o) has no symbolsranlib: file: .libs/libdb_tcl-4.3.a(snprintf.o) has no symbolsranlib .libs/libdb_tcl-4.3.aranlib: file: .libs/libdb_tcl-4.3.a(tcl_compat.o) has no symbolsranlib: file: .libs/libdb_tcl-4.3.a(tcl_lock.o) has no symbolsranlib: file: .libs/libdb_tcl-4.3.a(tcl_log.o) has no symbolsranlib: file: .libs/libdb_tcl-4.3.a(tcl_rep.o) has no symbolsranlib: file: .libs/libdb_tcl-4.3.a(snprintf.o) has no symbolscreating libdb_tcl-4.3.la(cd .libs && rm -f libdb_tcl-4.3.la && ln -s ../libdb_tcl-4.3.la libdb_tcl-4.3.la)/bin/sh ./libtool --mode=compile /usr/bin/gcc-4.0 -c -O2 -I../dist/.. -I/opt/local/include ../dist/../db_dump185/db_dump185.c/usr/bin/gcc-4.0 -c -O2 -I../dist/.. -I/opt/local/include ../dist/../db_dump185/db_dump185.c -fno-common -DPIC -o .libs/db_dump185.o../dist/../db_dump185/db_dump185.c: In function 'main':../dist/../db_dump185/db_dump185.c:212: warning: assignment makes pointer from integer without a cast../dist/../db_dump185/db_dump185.c:214: warning: assignment makes pointer from integer without a cast../dist/../db_dump185/db_dump185.c:229: error: 'struct __db' has no member named 'seq'../dist/../db_dump185/db_dump185.c:229: error: 'R_NEXT' undeclared (first use in this function)../dist/../db_dump185/db_dump185.c:229: error: (Each undeclared identifier is reported only once../dist/../db_dump185/db_dump185.c:229: error: for each function it appears in.)../dist/../db_dump185/db_dump185.c:234: error: 'struct __db' has no member named 'seq'../dist/../db_dump185/db_dump185.c: In function 'db_hash':../dist/../db_dump185/db_dump185.c:262: error: 'struct __db' has no member named 'internal'../dist/../db_dump185/db_dump185.c:264: error: 'struct __db' has no member named 'internal'../dist/../db_dump185/db_dump185.c: In function 'db_btree':../dist/../db_dump185/db_dump185.c:289: error: 'struct __db' has no member named 'internal'make: *** [db_dump185.lo] Error 1Digging on the DarwinPorts and Fink forums online (usually a goldmine for fixing issues like this) proved fruitless until I looked on the comp.databases.berkeley-db newsgroup and found that the thorn in the compiler's side was an optional component. At that point I had to dig up the MacPorts Portfile for db4 and manually remove the db_compat185 and db_dump185 options from configure.args. Cleaning and rebuilding solved my problem.

Thursday, July 26, 2007

Installing WordPress

WordPress is well known for its ease of installation. Under most circumstances installing WordPress is a very simple process and takes less than five minutes to complete. The following installation guide will help you, whether you go for the Famous 5 Minute Installation, or require the more detailed installation guide.

WordPress Installed for Free
Introduction
Welcome to the Install4Free website. It is here you can request that a WordPress expert install WordPress at your domain.
Please note, we only do new installations, NOT upgrades.
This service is ONLY for individuals wishing to install WordPress for personal blogging purposes. Requests related to commercial sites will not be accepted.
This installation service is offered freely. The right to accept, or reject your request, is ours.
This free service is offered by people who are experienced in installing and using WordPress. These people are trusted by their peers and were nominated by their peers to provide this service to you.
Install4Free is not officially endorsed by, or connected to, WordPress.org or WordPress.com. Those organizations bear no responsibility for the success (or failure) of this project.
We are not lawyers, so without using lots of legal words and small print, please understand the following:

What this project is:
A way for you to have WordPress installed on your domain at no cost.
We do this so installation is not a hurdle to you using WordPress.
We also do this to increase our knowledge of installations of WordPress across different hosts so we can extend that knowledge to others.
What this project is not:
This is not a hosting service. You must have your own domain name and domain hosting before requesting this service. If you host your own domain, please don’t request our service–you’ve got the talent to install WordPress.
What we ask of you:
That you give the nominated person your hosting login and password. At a minimum, the nominated person needs to create a database, and upload files via FTP. A control panel login is ideal.
We will:
Install WordPress to your website into a directory called ‘wordpress’
Verify the blog works by making 1 post and 1 comment.
Delete (from our system) any passwords / cookies / browser information on completion.
Provide some links to additional information that may be of some use; ie, Codex, Support Forums, Theme viewer, and Plugin repository.
We will not:
Upgrade your existing blog
Host your blog
Install more than one blog
Instruct you on installation
Install any plugins
Install any themes
Troubleshoot anything other than install issues
Provide further support outside of the WordPress Support Forums
Ask for money, links, or any other form of reward or compensation

The Process
On the next page you must complete your contact details. Someone from the project will get in touch with you. This should be secure as only authorized individuals know you have asked for a free installation.
The package
At the end of the process you will have:
a fully working WordPress blog
Classic and WordPress Default themes
Akismet and Hello Dolly plugins, not activated
The Installation Process
When the installer contacts you, they will expect to be given full access to your webhost control panel.
The installer will download the latest WordPress version from wordpress.org/download. You cannot supply the file to be installed.
The installer will create the database, ensure that the database is correctly configured, upload the WordPress files via FTP, and install WordPress.
The installer will edit the initial install post (or create a new post) and make one comment to test that your blog is working.
After installation, the installer will advise you on pertinent information about your blog and provide you some links to help you in the initial stages.
Please do not:
Ask or expect the installer to do more than what is listed above.
Ask for security advice.
Contact the installer seeking further advice.
If you have read and understand all of the above, click Next to enter your contact information:

how to install apache, PHP and MySQL on Linux

This tutorial explains the installation of Apache web server, bundled with PHP and MySQL server on a Linux machine. The tutorial is primarily for SuSE 9.2, 9.3, 10.0 & 10.1 operating systems, but most of the steps ought to be valid for all Linux-like operating systems.

MySQL 5.0 installation
Since Apache and MySQL servers must be installed prior to the PHP installation, I recommend installing the triad in this order: MySQL, Apache, PHP. You may well have some MySQL server already installed – in that case you can skip directly to the Apache 2 installation. However, it's a good idea to reinstall everything, in order to have the most recent versions of the software.
There are several options for how to install MySQL:
using YaST – the easiest and fastest way. However, the version of MySQL bundled with SuSE installation is usually NOT the best (i.e. the most recent) available,
RPM installation – supposedly also fast and simple, I've never tried though. The only drawback here is that MySQL is not installed into a single destination – it's scattered across several directories. I like to keep things tidy, so I skipped this option,
installing binaries – downloading precompiled files from the mysql.com website, copying them into a directory of your choice, and doing some simple configuration. I tried this, but it didn't work for me – for some reason the MySQL server wouldn't start,
installing from source – I would recommend this. Yes, it takes some time and effort, but you will get the most recent MySQL installed in a single location on your system, and everything will be configured according to your needs.
The rest of this chapter deals with the 4th option – the installation of MySQL from the source.
prerequisites
Make sure you have superuser (root) privileges and user "mysql" already exists in your system. If not, create one: # groupadd mysql # useradd -g mysql mysql
This will be the default user under which the MySQL server will be running.
download the source
First, download MySQL source . You need the mysql-5.0.37.tar.gz tarball file.
unpack, configure, compile
So you have downloaded the mysql-5.0.37.tar.gz file. You know the drill: unpack, configure, make, make install:. # tar -xzf mysql-5.0.37.tar.gz # cd mysql-5.0.37# ./configure --prefix=/usr/local/mysql-5.0.37 --with-charset=utf8 --with-collation=utf8_general_ci# make# make install
We used the --with-charset and --with-collation options to set the default character set and collation – otherwise it would have been the default Swedish collation.
I recommend creating a symbolic link called "mysql" pointing to the MySQL installation directory, in order to make referring to it from elsewhere easier:# ln -s /usr/local/mysql-5.0.37/ /usr/local/mysql
This way we can always refer to MySQL installation directory as /usr/local/mysql . The obvious advantage is that if you install PHP with the --with-mysql=/usr/local/mysql option (see PHP 5 Installation Guide), it won't stop working if the name of the MySQL installation directory changes in the future (if you upgrade your MySQL for instance).
create my.cnf file
To complete MySQL server installation, you have to create a configuration file. It offers several security and control options (here you can limit system resources to be used by MySQL server, set the default collation and character set etc.). You need not to create a brand new configuration file – there are 4 pre-made files in the support-files/ directory. Read the information in those files to determine which one to use. For small servers (e.g. testing servers, or servers of a limited performance), my-small.cnf file is the best option. Copy the file of your choice to /etc/my.cnf:# cp support-files/my-small.cnf /etc/my.cnf # chown root /etc/my.cnf # chgrp root /etc/my.cnf # chmod 644 /etc/my.cnf
We have made sure both the owner and user group of the my.cnf file are "root" and the access privileges are properly set. Finally edit the file:# vi /etc/my.cnf
Search for [mysqld] clause, and add immediately below it:user = mysql
We have specified that MySQL service is to be run with user "mysql" privileges.
If you want to use InnoDB databases (what you probably will), uncomment (and perhaps edit) all innodb options in the my.cnf file. Save all changes ( :wq).
additional settings
For proper functioning, MySQL needs a "mysql" database. To create this database, simply run:# /usr/local/mysql/bin/mysql_install_db --user=mysql
The script will create /usr/local/mysql/var/ directory containing the necessary databases. This directory serves as a default storage for all databases you will create. Make sure it is writable by "mysql" system user!
start server, check it, connect
Now you are ready to start your MySQL server for the first time.# /usr/local/mysql/bin/mysqld_safe --user=mysql &
Hit enter again to get your prompt back. The MySQL server should now be running. To check that server is running and works properly enter# /usr/local/mysql/bin/mysqladmin version
You should get some response about the server software version.
Connect to MySQL server: # /usr/local/mysql/bin/mysql -u root
If you get a welcome message and the prompt changes to mysql>, the server works and everything is fine. If this failed for any reason, it may indicate some problems with your installation/configuration.
set the root password
Now, before you do anything else, set root user's password (!). Stay connected to MySQL and enter:DELETE FROM mysql.user WHERE User = '';FLUSH PRIVILEGES; SELECT Host, User FROM mysql.user;
Look for the record that has root in the User column and something other than localhost in the Host column. This is the host_name.SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new_password');SET PASSWORD FOR 'root'@'host_name' = PASSWORD('new_password');
Remember, this is the MySQL superuser for all databases. Therefore you should use a strong password and keep it safe. Later, when you will be writing PHP scripts, do NOT use superuser for accessing databases! The "root" user is meant only for administration purposes. After you are finished, exit MySQL:quit
restart MySQL server
After everything is set up, restart MySQL server:# /usr/local/mysql/bin/mysqladmin -u root -p shutdown # /usr/local/mysql/bin/mysqld_safe --user=mysql &
Voila, your MySQL server is up and running!
automatic startup
Set up an automatic startup so you don't need to start MySQL server manually after each system reboot. Go back to the directory where you extracted the downloaded mysql tarball file. Enter # cp support-files/mysql.server /etc/init.d/mysql # chmod 755 /etc/init.d/mysql # chkconfig --add mysql # chkconfig --level 35 mysql on

Installation on Unix systems Apache 2.0 on Unix systems

You are highly encouraged to take a look at the » Apache Documentation to get a basic understanding of the Apache 2.0 Server.
PHP and Apache 2.0.x compatibility notes: The following versions of PHP are known to work with the most recent version of Apache 2.0.x:
PHP 4.3.0 or later available at » http://www.php.net/downloads.php.
the latest stable development version. Get the source code » http://snaps.php.net/php5-latest.tar.gz or download binaries for Windows » http://snaps.php.net/win32/php5-win32-latest.zip.
a prerelease version downloadable from » http://qa.php.net/.
you have always the option to obtain PHP through » anonymous CVS. These versions of PHP are compatible to Apache 2.0.40 and later.
Apache 2.0 SAPI-support started with PHP 4.2.0. PHP 4.2.3 works with Apache 2.0.39, don't use any other version of Apache with PHP 4.2.3. However, the recommended setup is to use PHP 4.3.0 or later with the most recent version of Apache2.
All mentioned versions of PHP will work still with Apache 1.3.x.
Download the most recent version of » Apache 2.0 and a fitting PHP version from the above mentioned places. This quick guide covers only the basics to get started with Apache 2.0 and PHP. For more information read the » Apache Documentation. The version numbers have been omitted here, to ensure the instructions are not incorrect. You will need to replace the 'NN' here with the correct values from your files.

Example
1. gzip -d httpd-2_0_NN.tar.gz2. tar xvf httpd-2_0_NN.tar3. gunzip php-NN.tar.gz4. tar -xvf php-NN.tar5. cd httpd-2_0_NN6. ./configure --enable-so7. make8. make install Now you have Apache 2.0.NN available under /usr/local/apache2, configured with loadable module support and the standard MPM prefork. To test the installation use your normal procedure for starting the Apache server, e.g.: /usr/local/apache2/bin/apachectl start and stop the server to go on with the configuration for PHP: /usr/local/apache2/bin/apachectl stop.9. cd ../php-NN10. Now, configure your PHP. This is where you customize your PHP with various options, like which extensions will be enabled. Do a ./configure --help for a list of available options. In our example we'll do a simple configure with Apache 2 and MySQL support. Your path to apxs may differ, in fact, the binary may even be named apxs2 on your system. ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql11. make12. make install If you decide to change your configure options after installation, you only need to repeat the last three steps. You only need to restart apache for the new module to take effect. A recompile of Apache is not needed. Note that unless told otherwise, 'make install' will also install PEAR, various PHP tools such as phpize, install the PHP CLI, and more. 13. Setup your php.ini cp php.ini-dist /usr/local/lib/php.ini You may edit your .ini file to set PHP options. If you prefer having php.ini in another location, use --with-config-file-path=/some/path in step 10. If you instead choose php.ini-recommended, be certain to read the list of changes within, as they affect how PHP behaves.14. Edit your httpd.conf to load the PHP module. The path on the right hand side of the LoadModule statement must point to the path of the PHP module on your system. The make install from above may have already added this for you, but be sure to check. For PHP 4: LoadModule php4_module modules/libphp4.so For PHP 5: LoadModule php5_module modules/libphp5.so 15. Tell Apache to parse certain extensions as PHP. For example, let's have Apache parse the .php extension as PHP. You could have any extension(s) parse as PHP by simply adding more, with each separated by a space. We'll add .phtml to demonstrate. AddType application/x-httpd-php .php .phtml It's also common to setup the .phps extension to show highlighted PHP source, this can be done with: AddType application/x-httpd-php-source .phps 16. Use your normal procedure for starting the Apache server, e.g.: /usr/local/apache2/bin/apachectl start

Installation on Unix systems (Installation Instructions (Apache Shared Module Version) for PHP )

Installation Instructions (Static Module Installation for Apache) for PHP
1. gunzip apache_xxx.tar.gz2. tar -xvf apache_xxx.tar3. gunzip php-xxx.tar.gz4. tar -xvf php-xxx.tar5. cd apache_xxx6. ./configure --prefix=/www --enable-module=so7. make8. make install9. cd ../php-xxx10. Now, configure your PHP. This is where you customize your PHP with various options, like which extensions will be enabled. Do a ./configure --help for a list of available options. In our example we'll do a simple configure with Apache 1 and MySQL support. Your path to apxs may differ from our example. ./configure --with-mysql --with-apxs=/www/bin/apxs11. make12. make install If you decide to change your configure options after installation, you only need to repeat the last three steps. You only need to restart apache for the new module to take effect. A recompile of Apache is not needed. Note that unless told otherwise, 'make install' will also install PEAR, various PHP tools such as phpize, install the PHP CLI, and more.13. Setup your php.ini file: cp php.ini-dist /usr/local/lib/php.ini You may edit your .ini file to set PHP options. If you prefer your php.ini in another location, use --with-config-file-path=/some/path in step 10. If you instead choose php.ini-recommended, be certain to read the list of changes within, as they affect how PHP behaves.14. Edit your httpd.conf to load the PHP module. The path on the right hand side of the LoadModule statement must point to the path of the PHP module on your system. The make install from above may have already added this for you, but be sure to check. For PHP 4: LoadModule php4_module libexec/libphp4.so For PHP 5: LoadModule php5_module libexec/libphp5.so 15. And in the AddModule section of httpd.conf, somewhere under the ClearModuleList, add this: For PHP 4: AddModule mod_php4.c For PHP 5: AddModule mod_php5.c16. Tell Apache to parse certain extensions as PHP. For example, let's have Apache parse the .php extension as PHP. You could have any extension(s) parse as PHP by simply adding more, with each separated by a space. We'll add .phtml to demonstrate. AddType application/x-httpd-php .php .phtml It's also common to setup the .phps extension to show highlighted PHP source, this can be done with: AddType application/x-httpd-php-source .phps17. Use your normal procedure for starting the Apache server. (You must stop and restart the server, not just cause the server to reload by using a HUP or USR1 signal.)

Alternatively, to install PHP as a static object:

Installation Instructions (Static Module Installation for Apache) for PHP
Example 2
1. gunzip -c apache_1.3.x.tar.gz tar xf -2. cd apache_1.3.x3. ./configure4. cd ..5. gunzip -c php-5.x.y.tar.gz tar xf -6. cd php-5.x.y7. ./configure --with-mysql --with-apache=../apache_1.3.x8. make9. make install10. cd ../apache_1.3.x11. ./configure --prefix=/www --activate-module=src/modules/php5/libphp5.a (The above line is correct! Yes, we know libphp5.a does not exist at this stage. It isn't supposed to. It will be created.)12. make (you should now have an httpd binary which you can copy to your Apache bin dir if it is your first install then you need to "make install" as well)13. cd ../php-5.x.y14. cp php.ini-dist /usr/local/lib/php.ini15. You can edit /usr/local/lib/php.ini file to set PHP options. Edit your httpd.conf or srm.conf file and add: AddType application/x-httpd-php .php


Note: Replace php-5 by php-4 and php5 by php4 in PHP 4.
Depending on your Apache install and Unix variant, there are many possible ways to stop and restart the server. Below are some typical lines used in restarting the server, for different apache/unix installations. You should replace /path/to/ with the path to these applications on your systems.

Example commands for restarting Apache
1. Several Linux and SysV variants:/etc/rc.d/init.d/httpd restart2. Using apachectl scripts:/path/to/apachectl stop/path/to/apachectl start3. httpdctl and httpsdctl (Using OpenSSL), similar to apachectl:/path/to/httpsdctl stop/path/to/httpsdctl start4. Using mod_ssl, or another SSL server, you may want to manuallystop and start:/path/to/apachectl stop/path/to/apachectl startssl

The locations of the apachectl and http(s)dctl binaries often vary. If your system has locate or whereis or which commands, these can assist you in finding your server control programs.
Different examples of compiling PHP for apache are as follows:
./configure --with-apxs --with-pgsql

This will create a libphp5.so (or libphp4.so in PHP 4) shared library that is loaded into Apache using a LoadModule line in Apache's httpd.conf file. The PostgreSQL support is embedded into this library.
./configure --with-apxs --with-pgsql=shared

This will create a libphp4.so shared library for Apache, but it will also create a pgsql.so shared library that is loaded into PHP either by using the extension directive in php.ini file or by loading it explicitly in a script using the dl() function.
./configure --with-apache=/path/to/apache_source --with-pgsql

This will create a libmodphp5.a library, a mod_php5.c and some accompanying files and copy this into the src/modules/php5 directory in the Apache source tree. Then you compile Apache using --activate-module=src/modules/php5/libphp5.a and the Apache build system will create libphp5.a and link it statically into the httpd binary (replace php5 by php4 in PHP 4). The PostgreSQL support is included directly into this httpd binary, so the final result here is a single httpd binary that includes all of Apache and all of PHP.
./configure --with-apache=/path/to/apache_source --with-pgsql=shared

Same as before, except instead of including PostgreSQL support directly into the final httpd you will get a pgsql.so shared library that you can load into PHP from either the php.ini file or directly using dl().
When choosing to build PHP in different ways, you should consider the advantages and drawbacks of each method. Building as a shared object will mean that you can compile apache separately, and don't have to recompile everything as you add to, or change, PHP. Building PHP into apache (static method) means that PHP will load and run faster. For more information, see the Apache » web page on DSO support.

Note: Apache's default httpd.conf currently ships with a section that looks like this:
User nobodyGroup "#-1"

Unless you change that to "Group nogroup" or something like that ("Group daemon" is also very common) PHP will not be able to open files.
Note: Make sure you specify the installed version of apxs when using --with-apxs=/path/to/apxs. You must NOT use the apxs version that is in the apache sources but the one that is actually installed on your system.

Tuesday, July 24, 2007

How to Setup a Subversion Server on Windows

A while back I wrote an How To on how to setup a Subversion server on Linux. So anything you can do on Linux you should be able to do on Windows, right? Well I am not getting into that debate, but yes you can setup a Subversion server on Windows. Much like Linux there are many ways to accomplish this, today I will be talking about how to set it up using Apache. So let's take a look...
Downloads:
These are the recent versions of this date, please check for the latest stable versions at time of install.
apache_2.2.4-win32-x86-no_ssl.msi
svn-1.4.4-setup.exe
TortoiseSVN-1.4.4.9706-win32-svn-1.4.4.msi
Install:
First lets install Apache. You should be able to select all of the defaults during the installation process, unless you know what you are specifically trying to accomplish. Be sure to select "Apache Modules" where it talks about the SVN module.
Second lets install SVN, again the defaults work fine.
Third, and last install TortoiseSVN, yup defaults work good for this as well.
Configure Apache Password File:
First lets create a Apache password file, from a command line run:
C:\Program Files\Apache Group\Apache2\bin\htpasswd.exe -c C:\Program Files\Apache Group\Apache2\passwd myuser
Be sure to replace "myuser" with the username you wish to use for your login.
Create a Repository:
Next we need to create a subversion repository:
C:\Program Files\Subversion\bin\svnadmin.exe create C:\MyRepos

Configure Apache:
In Notepad open up the file "C:\Program Files\Apache Group\Apache2\conf\httpd.conf" and put the following at the end of the file:

DAV svnSVNPath "C:\MyRepos"AuthType BasicAuthName "My Subversion Repository"AuthUserFile passwdRequire valid-user

Presto! All you need to do is restart Apache via the neat little system tray icon, and import your repository and you are up and rolling.