Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have just installed Linux Suse 10.0 on my computer at my house and fowarded 2 domain names to my ip address. I have tried all i can, but i cannot figure out how to make it to where www.site1.com goes to a certain folder and www.site2.com goes to another folder. basically, i want to run more than one site from my server without them showing the same thing when accessed.
ok, i tried everything on there, but it is still not working. both domains are still going to to the default folder. Do i have to have the domains pointing to a Nameserver in order for apache to detect the site? both domains are just fowarded to my ip address. there are no nameservers set.
What would happen if you set up a NAT firewall, have two NICs on the server(each with a different IP) and then set up port forwarding on the NAT firewall. So, one server runs on port :80 and the other one runs on :8080. When you go to :80 on the NAT side, it routes you to the :80 apache server, and when you go to :8080 on the NAT side, it forwards it to the :8080 apache server.
Code:
| |(:8080)
|(Internet) |
---------------------(NAT)----------| (Both same comp but different NICs.
| |(:80)
|
ok, i found out that on Godaddy, you can set the total dns control host to the ip address of the server. i have already done that on 2 domains. now insead of both domains going directly to the ip address in the address bar, it now shows just the domain. Now, what do i have to do to make the server recognize what domain is what and point them to different folders? I already tried to add virtual hosts with the httpd.conf, but nothing is working. here is my config:
The most likely reason you are getting "access denied" is because the files have to be ownable by "apache.apache". I wouldn't know how to fix it, just pointing out the reasons ;-)
I have just installed Linux Suse 10.0 on my computer at my house and fowarded 2 domain names to my ip address. I have tried all i can, but i cannot figure out how to make it to where www.site1.com goes to a certain folder and www.site2.com goes to another folder. basically, i want to run more than one site from my server without them showing the same thing when accessed.
any help would be greatly appreciated!
its actually quite easy if you read and follow the instruction given in the apache manual in vhost section.
i've set up apache on 2 machines with mass vhost setting. so i can manage all the vhosts easily.
this is some part from the httpd.conf which set up the dynamic "virtual-host"ing
Code:
# get the server name from the reverse DNS of the IP address
UseCanonicalName DNS
# include the IP address in the logs so they may be split
LogFormat "%A %h %l %u %t \"%r\" %s %b" vcommon
CustomLog logs/access_log vcommon
# include the IP address in the filenames
VirtualDocumentRootIP /www/hosts/%0/docs
VirtualScriptAliasIP /www/hosts/%0/cgi-bin
with this, if i want to host a new domain (www.asik.com for example), all i have to do is only creating directory "/www/hosts/www.asik.com/", and put the web files on directory "/www/hosts/www.asik.com/docs/". and then restart/reload the apache daemon.
and the thing after that, of course you have to deal with nameserver you're connected with. so that all request for your page/domain should be redirected to your webserver.
Why not set apache user home to say /home/apache, make a directory called htdocs1 and htdocs2, then set it up from your apache conf file. If permissions are borked, try running something like this from console as root/su.
Code:
chown -R apache.apache /home/apache
Also running two servers on two different ports is a really long winded way of solving a simple problem. Using vhost's you can do both sites from one conf file and one server. The only time you would need a second server is if you wanted apache-ssl and didnt want to use mod_ssl.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.