LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-03-2006, 07:41 AM   #1
furqan_sindhu
LQ Newbie
 
Registered: May 2006
Posts: 25
Blog Entries: 1

Rep: Reputation: 15
apache addon domain


i m running apache on my local computer. ihave made it a server. is there soem way that i can add addon domains on my local computer ???
 
Old 10-03-2006, 08:17 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
How do you mean, addon domains. You might be talking about virtual hosts. There are two ways, name based virtial hosts and ip based virtual hosts. If you don't use https (not likely at home), you can use name based virtual hosts. look up the below section in httpd.conf and uncomment it (don't uncomment the comments).

Code:
#NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
Replace the red line with something that makes sense like
Code:
<VirtualHost website1:80>
Further you need to change the documentroot and the servername.
You can now copy the part from the red line onwards and change some data that applies to the second website. For this second part, change the red line to
Code:
<VirtualHost website2:80>
You also need a different documentroot and servername.

OK, next step is that the connecting computers can resolve the names website1 and website2. Easiest is probably to add them to the file /etc/hosts. They may all refer to the same ip-address.
Below an example if you only need to access them from your local PC
Code:
127.0.0.1               localhost
127.0.0.1               website1
127.0.0.1               website2
You should now be able access the websites in a browser by using http://website1 and http://website2

Haven't tested this, so I hope it's correct


PS IP based is similar, but you need to setup multiple IP addresses for your server and you should not disable the first line in the first code block in this post.
Further you need to specify IP addresses instead of names.

Last edited by Wim Sturkenboom; 10-03-2006 at 08:18 AM.
 
Old 10-03-2006, 12:58 PM   #3
furqan_sindhu
LQ Newbie
 
Registered: May 2006
Posts: 25

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Code:
<VirtualHost website1>
#    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /www/docs/mySite
#    ServerName 8887.localhost
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
this is the configuration of my http.conf now. but i cant find this /etc/hosts thingi. where is this ???
at least without this /etc/hosts part, http://website1 is not working !!!!
 
Old 10-03-2006, 10:04 PM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
It's a file on your system (file hosts in directory /etc). Any Linux/Unix system has one. If you're running this on Windows, just locate the file hosts, it is somewhere under the windows directory.
 
Old 10-04-2006, 09:17 AM   #5
furqan_sindhu
LQ Newbie
 
Registered: May 2006
Posts: 25

Original Poster
Blog Entries: 1

Rep: Reputation: 15
well niceeeeeeee !!!!!!!!!

thanks man !

i actually needed to install a website that required all this. that installed successfulyy. but now when i opens the web site main page by address http://website1 , it gives me the error that
Code:
Forbidden

You don't have permission to access /index.php on this server.
Apache/2.0.55 (Win32) DAV/2 PHP/5.1.1 Server at website1 Port 80
can u pls tell whats the wrong ?
 
Old 10-04-2006, 10:23 PM   #6
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Not sure, might be a file-permission issue.
 
Old 10-05-2006, 03:26 PM   #7
furqan_sindhu
LQ Newbie
 
Registered: May 2006
Posts: 25

Original Poster
Blog Entries: 1

Rep: Reputation: 15
while investigating this issue of file permission, i have come across a strange thing.

when i comment the "rewriteengine on" statement in .htaccess, website works properly, but on uncommenting, this file permission error appears.
well that was not the strange part. strange part is that, when i uncomment this "rewriteengine on" statement and deletes all rest of the contents of .htaccess file, still the same file permission error appears. why is that ???

any idea ??
 
Old 10-05-2006, 11:32 PM   #8
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Sorry, don't know. Maybe someone else can help out here.
 
  


Reply



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
Great little addon waveform2 Slackware 3 03-08-2006 08:30 PM
domain and apache Smokey Slackware 4 06-25-2005 02:16 PM
Apache domain name zeroGsa Linux - Software 4 04-20-2005 12:37 PM
An addon question..? xlr8films Linux - Newbie 2 03-05-2005 10:10 PM
apache: which domain name it says it's at? bdp Linux - Software 0 09-18-2003 10:40 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:44 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