GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   httpd.conf per domain (https://gfy.com/showthread.php?t=1051011)

GFED 12-22-2011 06:28 PM

httpd.conf per domain
 
if i want to add a line such as "ServerAlias *.example.com" to my httpd.conf, but only to one domain on my server is this possible and where do I create the file?

for example full path to domain public_html is "/usr/home/***username***/domains/***userdomain***.com/public_html"

I'm guessing I just create a file named httpd.conf one level up from public_html but it's not working.


Thanks for any help on this =)

Tempest 12-22-2011 06:36 PM

It goes in the VirtualHost part for the specific domain in the config file.. Unless of course you've got some weird setup.

GFED 12-22-2011 06:51 PM

i'm looking for an option besides editing the MAIN httpd.conf file. i'm sure I had this option on other hosts. just not sure of the file name or location to make appendages.

oscer 12-22-2011 06:52 PM

well as long as you have the Correct Syntax then you need to add a line in your main httpd.conf that shows it where to look for the virtualhost configs Again In the correct Syntax ... or stuff will break

Konda 12-22-2011 06:53 PM

There is only one httpd.conf on the server. You need root access to edit it. In the httpd.cond find the virtualhost entry for that domain and add the line inside the virtualhost part for that domain.

Tempest 12-22-2011 07:26 PM

Quote:

Originally Posted by GFED (Post 18647910)
i'm looking for an option besides editing the MAIN httpd.conf file. i'm sure I had this option on other hosts. just not sure of the file name or location to make appendages.

The option for doing it somewhere else only exits if the main http file includes separate virtual host file(s)...

raymor 12-22-2011 11:19 PM

Quote:

Originally Posted by Tempest (Post 18647977)
The option for doing it somewhere else only exits if the main http file includes separate virtual host file(s)...


Many control panels, such as CPanel and Directadmin, will by default include certain files if they exist. If you're using a control panel, post which one or email us for help.

However, this very much reminds me of the "how to start the car" instructions I once saw on the back of a visor. If you don't know how to START a car, you shouldn't be driving one. You should get driving lessons or take a taxi. We've seen a lot of "professionals" do a lot of REALLY dumb things with Apache configuration. If you need help with the mechanics of where to put your configuration, you would be wise to have a qualified person review the configuration you plan to use.

Kiopa_Matt 12-22-2011 11:24 PM

Two options:

1.) Look into and teach yourself mod_rewrite. You can have requests routed based on server name.

2.) Add one line to your httpd.conf file, such as "Include /path/to/my/httpd_conf/*". Then all files within that directory will be automatically included when Apache restarts, allowing you to create one httpd.conf per-domain, or whatever you wanted.

GFED 12-23-2011 01:28 AM

Quote:

Originally Posted by Tempest (Post 18647977)
The option for doing it somewhere else only exits if the main http file includes separate virtual host file(s)...

got it, thanks!

Diomed 12-23-2011 01:50 AM

Christ,

I hope all of you are making a ton of money.

Thank god I decided to take the easy route into being a webmaster.

Site concepts - pitch point - landing page - traffic buys - pay day.

Whew.

fris 12-27-2011 10:57 PM

Quote:

Originally Posted by GFED (Post 18647873)
if i want to add a line such as "ServerAlias *.example.com" to my httpd.conf, but only to one domain on my server is this possible and where do I create the file?

for example full path to domain public_html is "/usr/home/***username***/domains/***userdomain***.com/public_html"

I'm guessing I just create a file named httpd.conf one level up from public_html but it's not working.


Thanks for any help on this =)

maybe try mod_vhost_alias

something like this

Code:

<VirtualHost *:80>
  ServerName          example.com

  DocumentRoot        /home/user/domains
  VirtualDocumentRoot /home/user/domains/%0/public_html
</VirtualHost>

<VirtualHost *:80>
  ServerName          www
  ServerAlias        www.*

  DocumentRoot        /home/user/domains
  VirtualDocumentRoot /home/user/domains/%2+/public_html
</VirtualHost>

example /home/user/domains/gfy.com/public_html will work by creating a gfy.com/ dir with a subdir of public_html

this will create them on the fly.

chaze 12-28-2011 01:11 AM

You normaly would do the in the vhost part of the main file. But to avoid that you might be able to add something to the .htaccess I would go from there.

Barry-xlovecam 12-28-2011 07:31 AM

*example.com is a wildcard DNS record.

a.example.com, b.example.com, c.example.com, d.example.com, etc ... will all resolve to example.com with the same content if that is what you want to accomplish.

http://en.wikipedia.org/wiki/Wildcard_DNS_record


All times are GMT -7. The time now is 09:26 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123