LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-01-2009, 01:51 PM   #1
peddip
Member
 
Registered: Dec 2008
Posts: 51

Rep: Reputation: 16
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.
 
Old 06-01-2009, 01:55 PM   #2
watcher69b
Member
 
Registered: Nov 2007
Location: /home/watcher69b
Distribution: RH, Fedora & CentOS
Posts: 552

Rep: Reputation: 41
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/
 
Old 06-01-2009, 08:07 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,348

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
See Chap 25 http://www.linuxtopia.org/online_boo...ide/index.html
 
Old 06-02-2009, 08:28 AM   #4
peddip
Member
 
Registered: Dec 2008
Posts: 51

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by watcher69b View Post
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.
Attached Files
File Type: txt httpd.conf.txt (36.2 KB, 11 views)
 
Old 06-02-2009, 08:58 AM   #5
battletroll
Member
 
Registered: Dec 2004
Location: Alabama
Distribution: Slackware, Solaris,Fedora, CentOS, Redhat, SGI
Posts: 65

Rep: Reputation: 18
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>
 
Old 06-03-2009, 12:00 AM   #6
peddip
Member
 
Registered: Dec 2008
Posts: 51

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by battletroll View Post
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??
 
Old 06-11-2009, 12:56 AM   #7
peddip
Member
 
Registered: Dec 2008
Posts: 51

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by peddip View Post
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???
 
Old 06-11-2009, 02:09 AM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,348

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
host my own website - server newbie sycamorex Linux - Server 11 06-28-2007 02:20 PM
LXer: Being your own website host with Linux LXer Syndicated Linux News 4 04-17-2007 06:59 AM
How to host a website? Vodius Linux - Newbie 1 05-15-2005 04:39 PM
Free website host? Cyberian General 14 02-10-2005 12:09 AM
Linux actively refusing to host my website Chooco Linux - Networking 7 06-11-2002 05:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration