Faruque Ahmed : MCP, MCSA, MCSE, MCTS, MCIT, CCNA, OCA, OCP, GCP
-------
Step: 1. To install apache
# yum install httpd -y
Installed:
httpd.x86_64 0:2.4.6-45.el7.centos.4
Dependency Installed:
apr.x86_64 0:1.4.8-3.el7 apr-util.x86_64 0:1.5.2-6.el7
httpd-tools.x86_64 0:2.4.6-45.el7.centos.4 mailcap.noarch 0:2.1.41-2.el7
Complete!
[root@p /]# systemctl start httpd
[root@p /]# systemctl enable httpd
Step:2 To Create the directory for Virtual Host name
[root@proxy html]# mkdir -p /var/www/html/www.worldcm.net
[root@proxy html]# mkdir -p /var/www/html/www.faruq.com
[root@proxy html]# mkdir -p /var/www/html/www.arif.net
[root@proxy html]# ls
http://www.arif.net http://www.faruq.com http://www.worldcm.net
# echo "Welcome to My arif.net Website" > /var/www/html/www.arif.net/index.html
Step:3 To create index.html as per hosting namewise like, Similarly, to create worldcm and faruq
<html><head><title>www.arif.net</title></head><body><h1>The arif.net virtual host is working!</h1></body></html>Step:4 To setup ownership and permissions
[root@proxy /]# chown -R apache:apache /var/www/html/www.arif.net/[root@proxy /]# chown -R apache:apache /var/www/html/www.faruq.com/[root@proxy /]# chown -R apache:apache /var/www/html/www.worldcm.net/[root@proxy /]# chmod -R 755 /var/www/htmlStep:5 To setup Name based virtual hosting on apache
[root@proxy conf.d]# pwd
/etc/httpd/conf.d
[root@proxy conf.d]# vi httpd-vhost.conf
Create a configuration file for AWStats in Apache's conf.d directory:
sudo nano /etc/httpd/conf.d/awstats.conf
Add the following directives to allow access to the AWStats CGI script:
Alias /awstatsclasses "/usr/share/awstats/wwwroot/classes/"Alias /awstatscss "/usr/share/awstats/wwwroot/css/"Alias /awstatsicons "/usr/share/awstats/wwwroot/icon/"ScriptAlias /awstats/ "/usr/share/awstats/wwwroot/cgi-bin/"ShellCopy
After adding the configuration, restart Apache to apply the changes:
# systemctl restart httpd
--------