Page 4: Steps 8-End
<B>Step 8: Compile Apache</B>
Your all set to compile Apache. cd to the source and do it!
<tt># cd /path/to/apache_1.3.20<br/>
# ./configure --prefix=/usr/local/apache --activate-module=src/modules/php4/libphp4.a
# make
# make install</tt>
<B>Step 9: Edit the httpd.conf file</B>
All your compiling is done now! Your next step is to edit a config file for Apache. Open up this file as root (/usr/local/apache/conf/httpd.conf):
<center><img src="http://www.aselabs.com/images/articles/oct02/serverguide/apacheconf.gif"></center>
Add these lines anywhere:
<tt>AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4</tt>
Find the line DirectoryIndex it'll be in like html tags. Inside it add <tt>index.php</tt>. This tells Apache that index.php can be an index in a directory.
<B>Step 10: Copy the php.ini file</B>
From the php source directory, copy one of the php.ini files (they will be named with stuff like 'dist' on the end of it) to /usr/local/lib/php.ini. Change anything you want in the file to suit your needs.
<B>Step 11: Test your server</B>
Start the server:
<tt># /usr/local/apache/bin/apachectl start</tt>
One of the final tasks. Create a file, test.php and put it into the htdocs of the apache directory. This is the directory where the website is.
test.php:
<tt><?PHP phpinfo(); ?></tt>
Now browse to http://localhost/test.php and you should get a page with a whole lot of things. If you see it, you've got your server working! If not, <a href="/viewforum.php?forumid=15">ask for help in our Linux forum</a>.
<B>Step 12: More MySQL stuff</B>
Now we want to make mysql nice and safe and make sure it works also. cd to the mysql directory and then to the 'bin' directory.
<tt># cd /usr/local/mysql/bin
# ./safe_mysqld --user=mysql &
# ./mysqladmin -u root password somepassword</tt> Change to whatever password you want
<B>Step 13: Auto Start up</B>
Last step. This makes MySQL and Apache start up when the OS is loaded.
<tt># echo "/usr/local/mysql/bin/safe_mysqld --user=mysql &" >> /etc/rc.d/rc.local
# echo "/usr/local/apache/bin/apachectl start" >> /etc/rc.d/rc.local</tt>
Now open up a can/bottle of your favorite drink (Diet Pepsi is my Fav) and kick back and do some programming!
<center><big><a href="http://www.aseforums.com">Get all your questions answered in the forums</a>!></center>
Your all set to compile Apache. cd to the source and do it!
<tt># cd /path/to/apache_1.3.20<br/>
# ./configure --prefix=/usr/local/apache --activate-module=src/modules/php4/libphp4.a
# make
# make install</tt>
<B>Step 9: Edit the httpd.conf file</B>
All your compiling is done now! Your next step is to edit a config file for Apache. Open up this file as root (/usr/local/apache/conf/httpd.conf):
<center><img src="http://www.aselabs.com/images/articles/oct02/serverguide/apacheconf.gif"></center>
Add these lines anywhere:
<tt>AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4</tt>
Find the line DirectoryIndex it'll be in like html tags. Inside it add <tt>index.php</tt>. This tells Apache that index.php can be an index in a directory.
<B>Step 10: Copy the php.ini file</B>
From the php source directory, copy one of the php.ini files (they will be named with stuff like 'dist' on the end of it) to /usr/local/lib/php.ini. Change anything you want in the file to suit your needs.
<B>Step 11: Test your server</B>
Start the server:
<tt># /usr/local/apache/bin/apachectl start</tt>
One of the final tasks. Create a file, test.php and put it into the htdocs of the apache directory. This is the directory where the website is.
test.php:
<tt><?PHP phpinfo(); ?></tt>
Now browse to http://localhost/test.php and you should get a page with a whole lot of things. If you see it, you've got your server working! If not, <a href="/viewforum.php?forumid=15">ask for help in our Linux forum</a>.
<B>Step 12: More MySQL stuff</B>
Now we want to make mysql nice and safe and make sure it works also. cd to the mysql directory and then to the 'bin' directory.
<tt># cd /usr/local/mysql/bin
# ./safe_mysqld --user=mysql &
# ./mysqladmin -u root password somepassword</tt> Change to whatever password you want
<B>Step 13: Auto Start up</B>
Last step. This makes MySQL and Apache start up when the OS is loaded.
<tt># echo "/usr/local/mysql/bin/safe_mysqld --user=mysql &" >> /etc/rc.d/rc.local
# echo "/usr/local/apache/bin/apachectl start" >> /etc/rc.d/rc.local</tt>
Now open up a can/bottle of your favorite drink (Diet Pepsi is my Fav) and kick back and do some programming!
<center><big><a href="http://www.aseforums.com">Get all your questions answered in the forums</a>!></center>