LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   VirtualHost configuration (https://www.linuxquestions.org/questions/linux-newbie-8/virtualhost-configuration-4175582134/)

AdultFoundry 06-13-2016 04:48 AM

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.

AdultFoundry 06-13-2016 04:49 AM

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?

keefaz 06-13-2016 05:03 AM

On network side, ping domain.com and ping m.smutaroo.com are ok?

AdultFoundry 06-13-2016 05:09 AM

Quote:

Originally Posted by keefaz (Post 5560066)
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.

keefaz 06-13-2016 05:13 AM

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

AdultFoundry 06-13-2016 05:24 AM

Quote:

Originally Posted by keefaz (Post 5560070)
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.

keefaz 06-13-2016 05:54 AM

You have more than what you posted in VHs configs? Any Directory directives that add settings for DocumentRoot directories?

AdultFoundry 06-13-2016 05:57 AM

Quote:

Originally Posted by keefaz (Post 5560084)
You have more than what you posted in VHs configs? Any Directory directives that add settings for DocumentRoot directories?

No, this is it.

AdultFoundry 06-13-2016 06:36 AM

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.

Habitual 06-13-2016 06:57 AM

Quote:

Originally Posted by AdultFoundry (Post 5560107)
It looks like mod_evasive blacklist my own IP

Pornograph is broke?
Best Laugh I've had this week.


All times are GMT -5. The time now is 05:46 PM.