Welcome, Guest |
You have to register before you can post on our site.
|
Forum Statistics |
» Members: 5,213
» Latest member: tokowin99
» Forum threads: 4,030
» Forum posts: 16,405
Full Statistics
|
Online Users |
There are currently 372 online users. » 0 Member(s) | 370 Guest(s) Bing, Google
|
Latest Threads |
Top Up Game Online Cepat ...
Forum: Network Problems
Last Post: tokowin99
1 hour ago
» Replies: 0
» Views: 4
|
How to install Archboot i...
Forum: Network Problems
Last Post: Meup
2025-05-13, 01:41 PM
» Replies: 0
» Views: 393
|
clear logs in smoothwall
Forum: Security and Firewalls
Last Post: amanda63
2024-03-10, 03:27 PM
» Replies: 8
» Views: 84,919
|
I cannot install RedHat 8...
Forum: Redhat
Last Post: hybrid
2023-11-11, 01:01 PM
» Replies: 1
» Views: 39,441
|
How things are done, usin...
Forum: Xorg Problems
Last Post: ross
2023-09-04, 09:03 AM
» Replies: 0
» Views: 1,849
|
Im back.....
Forum: Hello
Last Post: anyweb
2021-01-17, 11:36 AM
» Replies: 1
» Views: 5,320
|
add mp3 plugin to xmms in...
Forum: Fedora
Last Post: anyweb
2021-01-17, 11:30 AM
» Replies: 11
» Views: 41,300
|
Configuring VSFTPd Server
Forum: FTP Server
Last Post: Johnbaca
2020-10-14, 10:25 AM
» Replies: 32
» Views: 115,095
|
Wolf won't play sound!
Forum: Game Problems
Last Post: Guest
2020-10-03, 05:51 PM
» Replies: 1
» Views: 53,290
|
Using git + python
Forum: How Do I?
Last Post: Clueless puppy
2020-08-21, 04:37 PM
» Replies: 0
» Views: 43,560
|
|
|
how to setup vhosts in apache |
Posted by: anyweb - 2004-04-20, 09:56 AM - Forum: LAMP
- Replies (3)
|
 |
after a lot of trial and error and valuable help on IRC I finally got vhosts to work in apache !
first of all, I am assuming you have compiled apache as per this apache how-to
secondly, the examples below are for a system that is based behind a NAT so local IP addresses (LAN) are used rather than domain names throughout, so if your apache server is NOT behind a NAT, then obviously replace the 100.0.0.3 IP address with your domain names or if you want, the WAN ip address.
ok...
let's say that for this example, that your server name is www.linux-noob.com and you want to have a vhosts called anyweb.kicks-ass.net and anyweb.homedns.org (heh, yup these are vhosts i have setup, and this is a WORKING example).
I am also assuming that you have already setup the DNS for the domains above to point to the WAN ip of your apache server,
if your apache server is behind a NAT then it will have a LOCAL ip address like 192.168.0.3 or something, if not, it will have the WAN ip address. In my case, my apache server is behind a NAT and gets a local IP from the firewall, the local ip for my apache server is 100.0.0.3 (you'll need to know that later).
so, lets open our apache conf file, scroll right down to the end of the file to section 3 shown below.
Code: vi /usr/local/apache/conf/httpd.conf
Quote:### Section 3: Virtual Hosts#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at <URL:http://www.apache.org/docs/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
#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>
ok, now lets add the VHOST sections, please note, that once you add a VHOST, even just one, and if your servername is www.linux-noob.com then after you have added the VHOST, apache will default to the VHOST server name, this is important to note and because of this you must also add your 'current' servername as the 'first' VHOST.
Code: NameVirtualHost 100.0.0.3:80
<VirtualHost 100.0.0.3:80>
ServerAlias www.linux-noob.com
ServerAdmin anyweb@linux-noob.com
DocumentRoot /usr/local/apache/htdocs/
ServerName linux-noob.com
</VirtualHost>
<VirtualHost 100.0.0.3:80>
# ServerAlias anyweb.kicks-ass.net
ServerAdmin anyweb@linux-noob.com
DocumentRoot /usr/local/apache/websites/kicks-ass/
ServerName anyweb.kicks-ass.net
</VirtualHost>
<VirtualHost 100.0.0.3:80>
# ServerAlias anyweb.homedns.org
ServerAdmin anyweb@linux-noob.com
DocumentRoot /usr/local/apache/websites/homedns/
ServerName anyweb.homedns.org
</VirtualHost>
Ok in the above CODE, I have 3 VHOSTS listed, the first is my 'real' servername www.linux-noob.com, the second and third, are my actual 'virtual domain names'.
If we take the third example, anyweb.homedns.org and examine the lines, we see that the first line is
Code: <VirtualHost 100.0.0.3:80>
.
That tells apache that we have a virtual host on the following ip address 100.0.0.3 and it's on port 80.
Lines with # infront are commented out and ignored.
The next line that interests us is this one
Code: DocumentRoot /usr/local/apache/websites/homedns/
This line tells apache that the virtual host called anyweb.homedns.org is situated locally in the directory /usr/local/apache/websites/homedns/.
Now, we have to tell apache what this virtual server 'domain name' is actually called,
Code: ServerName anyweb.homedns.org
the line above, tells apache to look for any requests to anyweb.homedns.org and point them to the DocumentRoot we specified above that.
That's it, pretty much done, now just close the section with this
so that your new VHOST section now reads something like
Code: <VirtualHost 100.0.0.3:80>
# ServerAlias anyweb.homedns.org
ServerAdmin anyweb@linux-noob.com
DocumentRoot /usr/local/apache/websites/homedns/
ServerName anyweb.homedns.org
</VirtualHost>
That in itself should work provided that you do indeed have a domain name called anyweb.homedns.org pointing to your WAN (internet) ip address (not the local IP address) and that you have created a directory locally called /usr/local/apache/websites/homedns/ and that you have chmod 755 that directory and chmod 644 any files in that directory.
If it doesn't work make sure that your BindAddress sedtion in httpd.conf is correctly pointing to your LOCAL ip (or WAN ip if no NAT involved) such as in my example
Code: BindAddress 100.0.0.3
ok to finish off and test your VHOST you should copy/paste your REAL server name details above the virtual host code above and make a minor change so that it looks like this:
Code: NameVirtualHost 100.0.0.3:80
<VirtualHost 100.0.0.3:80>
ServerAlias www.linux-noob.com
ServerAdmin anyweb@linux-noob.com
DocumentRoot /usr/local/apache/htdocs/
ServerName linux-noob.com
</VirtualHost>
<VirtualHost 100.0.0.3:80>
# ServerAlias anyweb.homedns.org
ServerAdmin anyweb@linux-noob.com
DocumentRoot /usr/local/apache/websites/homedns/
ServerName anyweb.homedns.org
</VirtualHost>
In the Code above, I have listed www.linux-noob as the FIRST vhost (and it is the 'default' website). If you do not list your default website in the VHOSTS section then all requests to it will fail.
Also note that the line
Code: NameVirtualHost 100.0.0.3:80
appears above the FIRST VHOST. This instructs apache to understand that it's using named virtual hosts, and they can be IP address (local or WAN) or DOMAIN NAMES (www.linux-noob.com).
Whatever you have in NameVirtualHost must correspond with what you have after the VirtualHost statement, in my case above, it is 100.0.0.3:80.
Also to note, in the first VHOST i have listed (the default website/linux-noob.com) i use the following line
Code: ServerAlias www.linux-noob.com
which instructs apache to give the server alias = what you specify. This is only required ONCE in the VHOST and it should generally be the 'default' website that you are hosting.
ok, still with me ? if so, now you want to test that it all worked, save your httpd.conf file and stop and then restart apache by doing as follows:
Code: [root@www root]# /usr/local/apache/bin/apachectl stop
[root@www root]# /usr/local/apache/bin/apachectl start
That's it, now test your VHOSTS !
here's three i've done already ;-)
[/url]https://www.linux-noob.com
http://anyweb.kicks-ass.net
[url=http://anyweb.homedns.org]http://anyweb.homedns.org
cheers
anyweb
|
|
|
Linux and WTS |
Posted by: MrCoffee - 2004-04-19, 02:03 PM - Forum: How Do I?
- Replies (2)
|
 |
Hi Everyone,
I am setting up a number of new Linux (RH9Pro) boxes to revamp our Engineering department. And I have been considering two different approaches to our MS Applications.
The first is to purchase and use Crossover, which reportedly will allow you to use MS Office and other MS Apps directly within the Linux environment. Swapping Viso and Office for OpenOffice and Dia is NOT an option. So I would run Office2000 and Visio 2002 under Crossover.
The second one has me wondering if the first is the right approach. I was playing around with my own personal install of RH9 and I noticed that one of the packages I installed without realizing it was Windows Terminal Services Client for Linux. Since we have TS here, thou we are not using it, it got me thinking that maybe that would be a better approach.
Does anyone have any experiences with the WTS cleint? Pro's or Con's of either idea?
Thanks!
MrCoffee
|
|
|
Nessus |
Posted by: enigma - 2004-04-18, 05:18 PM - Forum: How Do I?
- No Replies
|
 |
Hi, I am looking for a tutorial on the vunrability scanner Nessus, I have the packages Nessus & Nessus-Server installed, I got the server started but when I try to login to Nessus and do a scan it says somthing about can't get SSH, so if you have any info I would greatly appreciate it thanks guys...
|
|
|
Bluetooth in Fedora Core 1. |
Posted by: xenix - 2004-04-16, 09:19 PM - Forum: Fedora Core Release 1
- Replies (2)
|
 |
Hi,
I need som help setting up my usb bluetooth adapter in Fedora Core 1.
I have a dlink dbt-120 bluetooth adapter.
I plgg it in, search for it with my phone, but it finds nothing.
Anyone that knows what I have todo?
----------Edit----------
I might also add that I use Gnome as my DM.
----------Edit----------
|
|
|
Bluetooth in Fedora Core 1 |
Posted by: xenix - 2004-04-16, 09:00 PM - Forum: Redhat
- No Replies
|
 |
Ops. A bit eagre to post. I'm moving this to the cedora section.
Sorry. ;)
Hi,
I need som help setting up my usb bluetooth adapter in Fedora Core 1.
I have a dlink dbt-120 bluetooth adapter.
I plgg it in, search for it with my phone, but it finds nothing.
Anyone that knows what I have todo?
|
|
|
mozilla and real player |
Posted by: tek-69 - 2004-04-16, 01:37 PM - Forum: Web Browsers
- Replies (1)
|
 |
Sose i went and downloaded real player cuz so much net stuff uses it. real works, mozilla works but anytime i try an go see dave chappelle makin' fun of white people and crackheads , my browser swears i dont have real player installed. what am i doin wrong/what havent i done?
thanks,
tek
|
|
|
Setting up the router for web-server |
Posted by: enigma - 2004-04-16, 12:10 AM - Forum: How Do I?
- Replies (1)
|
 |
I finally got all the web-server stuff working but now i am having some issues with the router i think, I am not sure how to set up the forward ports part I have a screen shot of the admin section of the router but I don't know how to post it here hehe. So I can send it through IRC if you want to help I am in the #fedora channel thanks...
|
|
|
|