LinuxQuestions.org
Review your favorite Linux distribution.
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, 05:48 AM   #1
AdultFoundry
Member
 
Registered: Jun 2015
Posts: 245

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, 05:49 AM   #2
AdultFoundry
Member
 
Registered: Jun 2015
Posts: 245

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 05:52 AM.
 
Old 06-13-2016, 06:03 AM   #3
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 5,387

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

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, 06:13 AM   #5
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 5,387

Rep: Reputation: 397Reputation: 397Reputation: 397Reputation: 397
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 06:14 AM.
 
Old 06-13-2016, 06:24 AM   #6
AdultFoundry
Member
 
Registered: Jun 2015
Posts: 245

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, 06:54 AM   #7
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 5,387

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

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, 07:36 AM   #9
AdultFoundry
Member
 
Registered: Jun 2015
Posts: 245

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, 07:57 AM   #10
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,159
Blog Entries: 10

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 08:12 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration