The advantage of using yum (as opposed to installing via source code) is that you will get any security updates (if and when distributed) and dependencies are automatically taken care of.
Apache Install
A basic Apache install is very easy:
yum install httpd mod_sslServerName
Oddly, the server does not start automatically when you install it so you have to do this by hand:
/etc/init.d/httpd startThe first thing you will see is this error:
Starting httpd: httpd: Could not reliably determine the server’s fully qualified domain name,As you can see, the address 127.0.0.1 is used as the ServerName by default. It’s a good idea to set the ServerName for the next time the server is started.
using 127.0.0.1 for ServerName
Open the main apache config:
nano /etc/httpd/conf/httpd.confTowards the end of the file you will find a section that starts with ‘ServerName’ and gives the example:
#ServerName www.example.com:80All you need to do is enter your Slice hostname or a FQDN:
ServerName demoNote that my Slice hostname is ‘demo’.
Reload Apache:
/etc/init.d/httpd reloadNow the warning has gone. Nice.
Default Page
If you navigate to your Slice IP address:
http://123.45.67.110You will see the default CentOS Apache welcome screen:
I think that’s a good start.
Chkconfig
Now that we have Apache installed and working properly, we need to make sure that it’s set to start automatically if the slice is rebooted.
sudo /sbin/chkconfig httpd onLet’s check our work to confirm:
sudo /sbin/chkconfig –list httpdGood.
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
PHP5 Install
Let’s move on to the PHP5 install. I’m not going to install all the modules available. Just a few common ones so you get the idea.
As before, due to using yum to install PHP5, any dependencies are taken care of:
yum install php-common php-gd php-mcrypt php-pear php-pecl-memcache php-mhash php-mysql php-xmlOnce done, do a quick Apache reload:
/etc/init.d/httpd reloadDone.
Tidak ada komentar:
Posting Komentar