LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 06-13-2016, 04:48 AM   #1
AdultFoundry
Member
 
Registered: Jun 2015
Posts: 282

Rep: Reputation: Disabled
VirtualHost configuration


I have a website domain.com and a mobile version on m.domain.com. The regular site is in /home/www/html/domain.com and the mobile version is in /home/www/html/domain.com/m.

Is something like this in /etc/httpd/conf.d/domain.com.conf correct, or can I do it differently / better?

<VirtualHost *:80>
ServerRoot /home/www/html/domain.com
ServerName domain.com
</VirtualHost>

<VirtualHost *:80>
ServerRoot /home/www/html/domain.com/m
ServerAlias m.smutaroo.com
</VirtualHost>

Is this how I do it or not. I am used to cPanel and I've never really worked on things like this.

httpd -t returns syntax ok but I have some connectivity problems with this website (it does not work / load basically) and it looks like it could be related to this.

Thanks.
 
Old 06-13-2016, 04:49 AM   #2
AdultFoundry
Member
 
Registered: Jun 2015
Posts: 282

Original Poster
Rep: Reputation: Disabled
And this is kind of odd, because if I go to domain.com it does not work at all, but when I enter domain.com/phpinfo.php it loads normally / right away.

Edit:
I have 6 different websites on the server and 6 separate config files like this in /etc/httpd/conf.d
The websites dont seem to load very good, and this could be related to this. Should I put it all in one file maybe and write it out differently all together, or what would be the best way to go?

Last edited by AdultFoundry; 06-13-2016 at 04:52 AM.
 
Old 06-13-2016, 05:03 AM   #3
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
On network side, ping domain.com and ping m.smutaroo.com are ok?
 
Old 06-13-2016, 05:09 AM   #4
AdultFoundry
Member
 
Registered: Jun 2015
Posts: 282

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by keefaz View Post
On network side, ping domain.com and ping m.smutaroo.com are ok?
Ping on both the domain and the subdomain is ok, 0% packet loss.
 
Old 06-13-2016, 05:13 AM   #5
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Now replace all ServerRoot words with DocumentRoot in your conf files
ServerRoot is for the installed server dir, nothing to do with vh

Last edited by keefaz; 06-13-2016 at 05:14 AM.
 
Old 06-13-2016, 05:24 AM   #6
AdultFoundry
Member
 
Registered: Jun 2015
Posts: 282

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by keefaz View Post
Now replace all ServerRoot words with DocumentRoot in your conf files
ServerRoot is for the installed server dir, nothing to do with vh
I have that in the config, I made a mistake here. It is DocumentRoot everywhere.
 
Old 06-13-2016, 05:54 AM   #7
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
You have more than what you posted in VHs configs? Any Directory directives that add settings for DocumentRoot directories?
 
Old 06-13-2016, 05:57 AM   #8
AdultFoundry
Member
 
Registered: Jun 2015
Posts: 282

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by keefaz View Post
You have more than what you posted in VHs configs? Any Directory directives that add settings for DocumentRoot directories?
No, this is it.
 
Old 06-13-2016, 06:36 AM   #9
AdultFoundry
Member
 
Registered: Jun 2015
Posts: 282

Original Poster
Rep: Reputation: Disabled
I get a strange error, in red, when I enter systemtcl stauts http. It looks like mod_evasive blacklist my own IP (the server IP, the one on which the websites are hosted) because of a possible DoS attack.
 
Old 06-13-2016, 06:57 AM   #10
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by AdultFoundry View Post
It looks like mod_evasive blacklist my own IP
Pornograph is broke?
Best Laugh I've had this week.
 
  


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
Apache Default Index page Not working after VirtualHost Configuration raheel_com88 Linux - Software 3 09-09-2015 02:35 PM
Apache2 configuration - help me understand VirtualHost vs NameVirtualHost CNBarnes Linux - Server 11 10-20-2010 11:38 AM
VirtualHost amdathlonboy Linux - Networking 2 06-22-2004 05:23 AM
Apache: Virtualhost configuration problem deepika Linux - Software 3 08-12-2003 10:13 AM
SSL Configuration on an Apache VirtualHost sancho5 *BSD 6 07-29-2002 08:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:41 AM.

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