LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to host a website in linux (https://www.linuxquestions.org/questions/linux-server-73/how-to-host-a-website-in-linux-729922/)

peddip 06-01-2009 01:51 PM

How to host a website in linux
 
Hi,

I have a RHEL4 server which already has a web server running on it(Intranet purpose) and it was configured by webadmin earlier. Now i want to host a web with out changing the existing web.How can i do that???

All the web related stuff is stored in /var/www/html

I have some jsp pages created by developers and i want to host a website using it.

watcher69b 06-01-2009 01:55 PM

in the /etc/httpd/
you can setup virtual directories in the httpd.conf file

for example http://something.com -> var/www/ & http://somthing.bob.com -> var/www/bob/

chrism01 06-01-2009 08:07 PM

See Chap 25 http://www.linuxtopia.org/online_boo...ide/index.html

peddip 06-02-2009 08:28 AM

1 Attachment(s)
Quote:

Originally Posted by watcher69b (Post 3559368)
in the /etc/httpd/
you can setup virtual directories in the httpd.conf file

for example http://something.com -> var/www/ & http://somthing.bob.com -> var/www/bob/

Hi,

I've tried confuguring virtual hosts by editing httpd.conf file but i'm not sure how i can browse my virtual host.

please find the attached httpd.conf file with virtual host settings and let me know if it has any errors.

battletroll 06-02-2009 08:58 AM

Based on the httpd.conf, www.myserver.com is the default you will need a dns entry for the www.myserver1.com unless you are only using it on an internal net then host file will work.

NameVirtualHost *:80 Tells apache to use virtual hosts based on names

<VirtualHost *:80> Tells apache the 1st virtualhost
DocumentRoot /path/to/files Virtual host doc root
ServerName www.myserver.com Actual server name that will be used by apache
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /path/to/different/files
ServerName www.someone.com
</VirtualHost>

peddip 06-03-2009 12:00 AM

Quote:

Originally Posted by battletroll (Post 3560338)
Based on the httpd.conf, www.myserver.com is the default you will need a dns entry for the www.myserver1.com unless you are only using it on an internal net then host file will work.

NameVirtualHost *:80 Tells apache to use virtual hosts based on names

<VirtualHost *:80> Tells apache the 1st virtualhost
DocumentRoot /path/to/files Virtual host doc root
ServerName www.myserver.com Actual server name that will be used by apache
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /path/to/different/files
ServerName www.someone.com
</VirtualHost>

Thanks for you reply. Using these modifications in my httpd.conf file i am able to browse www.myserver.com amd www.myserver1.com in the server where i hosted the website, But when i try to browse it from my desktop i am unable to do that. I have added entries of both www.myserver.com and www.myserver1.com in servers host file as i need to access this site internally with in our lan (Intranet) after which i am able to browse both the urls in server. How can i browse them from my desktop??

peddip 06-11-2009 12:56 AM

Quote:

Originally Posted by peddip (Post 3561184)
Thanks for you reply. Using these modifications in my httpd.conf file i am able to browse www.myserver.com amd www.myserver1.com in the server where i hosted the website, But when i try to browse it from my desktop i am unable to do that. I have added entries of both www.myserver.com and www.myserver1.com in servers host file as i need to access this site internally with in our lan (Intranet) after which i am able to browse both the urls in server. How can i browse them from my desktop??

Hi,

Can any one suggest on this query???

chrism01 06-11-2009 02:09 AM

You'll need a DNS entry; either on your DNS server if you have one, or in your desktop's /etc/hosts file, so it knows how to find the right system.
In the latter case, only you will see them...
Before DNS was invented, every system on the then ARPANET had a complete list of all systems in its hosts file. Obviously that doesn't scale, so DNS (& bind) was invented.


All times are GMT -5. The time now is 09:10 PM.