Twitter
RSS

Apache Web Server Configuration in Linux Redhat ES4

Web Server had become so important into today e-commerce. For RedHat Administrator task to setup a fast, efficient and reliable web server. Apache supports nearly all technology of web such as PHP, XML, JSP and ASP. Apache has very strong point of usage which is PHP. There are three type of Apache – Single Domain, IP Based Virtual Host and Name Based Virtual Host.

Single Domain:
Apache is a single domain only running on port 80 of your network interface. The default conf. files of apache located in /etc/httpd and the root home can be located in /var/www/html.

To check whether Apache is there or not the command: rpm –q httpd
files store in /etc/www
Then go ntsysv and check whether httpd select – vi /etc/httpd/conf.d (global conf. can’t change)

My setup of Apache web server will incorporate PHP and MySQL, it is so famous for the acromyn LAMP (Linux, Apache, MySQL, PHP) google and yahoo is built from this platform. During installation package selection or even installation of RedHat via rpm. Open web browser and test your web server http://192.168.0.1/ (you should see Apache test page)

RHEL 4 has Apache 2.0 / PHP 4.3 / PERL 5.8 / MySQL 4.1
Apache 2.0 virtural host conf. should be save /etc/httpd/conf.d/profile.conf

IP Based Virtual Host:
If you don’t have any plan to register your domain, but you need to have web services over internet, your have no option but to use IP Based Virtual Host. Virtual host mean allows you to create another web server service to listen on another IP address or interface. If don’t have dns therefore Apache will listen on Virtual IP. Right now create a virtual ip either you preferred method, command line or system config network (XII). If you have only one interaface create alias eth1 to eth1:1 and assign different IP. Then restart network service change to take effect.

First create Virtual IP, 192.168.0.2 – eth1 and 192.168.0.3/0.4 – eth1:1/eth1:2

Create User (unix accnt): adduser alvin –g apache –d /var/www/alvin
Adduser sharif –g apache –d/var/www/sharif

Edit files
vi /etc/httpd/conf.d/alvin.conf

Document Root /var/www/alvin/public_html
Server Name http://www.alvin.com/
Directory Index index.html index.htm index.shtml


vi /etc/httpd/conf.d/sharif.conf

Document Root /var/www/sharif/public_html
Server Name http://www.sharif.com/
Directory Index index.html index.htm index.shtml


Then go each user create sample file as below:
[root@server01 alvin]# cd public_html [root@server01 sharif]# cd public_html
[root@server01 public_html]# vi index.html [root@server01 public_html]# vi index.html


Hello World! I’m a Red Hat Linux System Administrator!



Save the file the restart Apache - service httpd restart

Click on webbrowser: http://192.168.0.3/ or http://192.168.0.4/ to see the test page.


Name Based Virtual Host:
If you have a DNS properly registered resolve and you have a static IP, then you can create Name Based Virtual Host. Imagine a Single IP address having multiple host name alias.

First create Virtual IP, 192.168.0.2 – eth1 and 192.168.0.3 – eth1:1
Ex: 192.168.0.3 – www.alvin.com/www.sharif.com/www.shasmeen.com

Create User (unix accnt): adduser alvin –g apache –d /var/www/alvin (sharif / shasmeen)

Edit files
vi /etc/httpd/conf.d/alvin.conf

Document Root /var/www/alvin/public_html
Server Name http://www.alvin.com/
Directory Index index.html index.htm index.shtml


vi /etc/httpd/conf.d/sharif.conf

Document Root /var/www/sharif/public_html
Server Name http://www.sharif.com/
Directory Index index.html index.htm index.shtml

Then go each user create sample file as below:
[root@server01 alvin]# cd public_html [root@server01 sharif]# cd public_html
[root@server01 public_html]# vi index.html [root@server01 public_html]# vi index.html


Hello World! I’m a Red Hat Linux System Administrator!



Save the file the restart Apache - service httpd restart

Click on webbrowser: http://www.alvin.com/ or http://www.sharif.com/ to see the test page.

Comments (0)

Post a Comment