The first step is to install Apache
yum install httpdNow, you can switch it on with
service httpd startSince you presumably want the web server to be running automatically at boot, you need to do the following:
chkconfig httpd onThat's it, you now have a apache running and configured to start at boot. You just need to allow traffic to it, so open the firewall for port 80 and save it:
iptables -I INPUT -p tcp --dport http -j ACCEPT; iptables-save > /etc/sysconfig/iptablesYou can check this by using a browser to navigate to localhost, e.g.
elinks 127.0.0.1
echo "hello" > /var/www/html/index.htmlif we try elinks again:
elinks 127.0.0.1Obviously this is just the beginning and you can have a look at the configuration file for Apache, /etc/httpd/conf/httpd.conf, which is very well commented or you could have a look at the manual.
No comments:
Post a Comment