Tech Support Forum banner
Status
Not open for further replies.
1 - 20 of 26 Posts

· Registered
Joined
·
148 Posts
Discussion Starter · #1 ·
i have a maching running a website already, however my dad and i are starting a car club that i want to make a site for, the site i have now is on port 8080, how could i make a different server on port say 8081 you can see the site thats now hosting on jakes58.hopto.org any ideas? thanks
 

· Premium Member
Joined
·
2,224 Posts
There's no need to run a seperate apache process if you want to have a second website. And I'm assuming you mean you're using port 80, not port 8080. To get Apache to serve more then 1 website, you need to edit the apache.conf file and add a second VirtualHost section at the very bottom of the config file. You'll need to edit the VirtualHost section accordingly however. If you need help with this, please let us know.
 

· Registered
Joined
·
18,185 Posts
Skie, I'ma fly you down to San Antonio so I can lern everything you know! To keep this thread going I'm gonna ask exactly how that modification is done. At present I have a single machine running Apache 2 and it hosts 3 sites. Right now I just use URL redirects to go to the directories that the data resides in. ex. http://199.199.199.1/ors http://199.199.199.1/KD http://199.199.199.1/ors/tws...
 

· Registered
Joined
·
148 Posts
Discussion Starter · #4 ·
no i mean 8080, when i had it on 80 no one could access it from outside, i think isp is blocking servers from that port,

and could you let me know how this is done
 

· Premium Member
Joined
·
2,224 Posts
ebackhus, pay for my flight, hotel and my time, and I'll teach you. :grin: :wink:

However, since you're doing directly by IP, it's not as simple. You can do something like "1.2.3.4/~username", but that's kind of ugly. Otherwise, you'll need to point 3 domains to your server if you want to do the VirtualHost method I describe below.

warlocke, the reason I mentioned port 80 is because I assumed the domain you listed was where the site was located on your computer. Sorry for misunderstanding.

Here's an example VirtualHost:

Code:
<VirtualHost 1.2.3.4> 
ServerAlias example.com
ServerAdmin [email protected]
DocumentRoot /home/username/public_html
BytesLog domlogs/example.com-bytes_log
ServerName www.example.com
User username
Group groupname
CustomLog /usr/local/apache/domlogs/example.com combined
ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/
</VirtualHost>
For each domain that you wish to host, you'll need the above block of config lines. The first line where the 1.2.3.4 is located, that's your IP address. It can be the same for each block of lines. Everywhere that I have "example.com", put the domain name that you're defining. The DocumentRoot line is where you specify where the HTML/PHP files are located for that domain name. Please use the proper path for your environment.

The User and Group lines are the username and group for the user that will own these files. In my envorionment, since each user account has its own public_html within their home directory, I use that users username/group so that no 2 users have access to each others files. Obviously, there are other security issues to consider, but this is just one of the basic ideas to implement if this is a concern. If you're the only user, then this isn't as big of an issue.

Set the CustomLog and BytesLog paths as appropriate for your environment if you wish to have log files that you can run through Awstats or Webalizer. The ScriptAlias line defines where the cgi-bin will be located so that any CGI scripts will be treated as such. This will also benefit from the User/Group lines.

Keep in mind that every invironment is slightly different, so edit the above lines as appropriate for yours. Just copy/pasting those lines won't work otherwise. You can have as many VirtualHost blocks as needed. I've had several hundred without issues. If you have multiple IP's to use, you can define an IP for each VirtualHost. Also, for different ports, you can use the following: <VirtualHost 1.2.3.4:8080>

Since you already have a site up and running, locate the existing VirtualHost and copy that block and modify it as needed.
 

· Registered
Joined
·
148 Posts
Discussion Starter · #9 · (Edited)
ok this is the url im using for what will be our car club site, notperfect.no-ip.org
i just downloaded a template and threw in the notperfect directory but it goes straight to the other site, i can access the notperfect but the vhost isnt redirecting it, let me open the other machine and log in here and ill post it. one second
but this is what it should be pulling up

http://notperfect.no-ip.org/notperfect
 

· Registered
Joined
·
148 Posts
Discussion Starter · #10 ·
ok this is my vhost block
i forgot to mention the apache server is running on windows server 2000

<VirtualHost 192.168.40.110>
ServerAlias notperfect.no-ip.org
ServerAdmin [email protected]
DocumentRoot E:\website\notperfect
#BytesLog C:\Program Files\Apache Software Foundation\Apache2.2\logs\notperfect-bytes_log
ServerName notperfect.no-ip.org
#User chuck
#Group groupname
#CustomLog "C:\Program Files\Apache Software Foundation\Apache2.2\logs\notperfect"
#ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/
</VirtualHost>
 

· Premium Member
Joined
·
2,224 Posts
Generally this is located in the htdocs directory on Windows and *nix systems.
You don't want the httpd.conf file in the htdocs folder. htdocs is a public folder and you don't want people to have access to the config file.

ok this is the url im using for what will be our car club site, notperfect.no-ip.org
i just downloaded a template and threw in the notperfect directory but it goes straight to the other site, i can access the notperfect but the vhost isnt redirecting it, let me open the other machine and log in here and ill post it. one second
but this is what it should be pulling up

http://notperfect.no-ip.org/notperfect
Based on your VHost, http://notperfect.no-ip.org will take you you E:\website\notperfect and http://notperfect.no-ip.org/notperfect will take you to E:\website\notperfect\notperfect
 

· Registered
Joined
·
148 Posts
Discussion Starter · #12 ·
but its not, i know thats how it should be but its not, its just going to e:\website and the one with the \notperfect goes to

e:\website\notperfect, wats going on here?
 

· Registered
Joined
·
148 Posts
Discussion Starter · #14 ·
<VirtualHost 192.168.40.110>
ServerAlias [email protected]
ServerAdmin [email protected]
DocumentRoot E:\website
#BytesLog C:\Program Files\Apache Software Foundation\Apache2.2\logs\jakes58-bytes_log
ServerName jakes58.hopto.org
#User chuck
#Group groupname
#CustomLog "C:\Program Files\Apache Software Foundation\Apache2.2\logs\jakes58"
#ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/
</VirtualHost>

<VirtualHost 192.168.40.110>
ServerAlias notperfect.no-ip.org
ServerAdmin [email protected]
DocumentRoot E:\website\notperfect
#BytesLog C:\Program Files\Apache Software Foundation\Apache2.2\logs\notperfect-bytes_log
ServerName notperfect.no-ip.org
#User chuck
#Group groupname
#CustomLog "C:\Program Files\Apache Software Foundation\Apache2.2\logs\notperfect"
#ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/
</VirtualHost>
 

· Premium Member
Joined
·
2,224 Posts
The first VHost is slightly wrong. The ServerAlias should not be an email address. I suggest changing that to no-ip.org or whatever you want it to be when someone visits that site.
 

· Premium Member
Joined
·
2,224 Posts
How about the following:

Code:
<VirtualHost 192.168.40.110> 
ServerAlias no-ip.org
ServerAdmin [email protected]
[b]DocumentRoot E:\website\noip[/b]
#BytesLog C:\Program Files\Apache Software Foundation\Apache2.2\logs\jakes58-bytes_log
ServerName jakes58.hopto.org
#User chuck
#Group groupname
#CustomLog "C:\Program Files\Apache Software Foundation\Apache2.2\logs\jakes58"
#ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/
</VirtualHost>

<VirtualHost 192.168.40.110> 
ServerAlias notperfect.no-ip.org
ServerAdmin [email protected]
DocumentRoot E:\website\notperfect
#BytesLog C:\Program Files\Apache Software Foundation\Apache2.2\logs\notperfect-bytes_log
ServerName notperfect.no-ip.org
#User chuck
#Group groupname
#CustomLog "C:\Program Files\Apache Software Foundation\Apache2.2\logs\notperfect"
#ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/
</VirtualHost>
Basically, put each site in a completely seperate folder.
 
1 - 20 of 26 Posts
Status
Not open for further replies.
Top