Apache :: How To Set Up Virtual Subdomains

Feb 10, 2014

I'm using the following vhost script: URL...This used to work on an older version of apache in Windows. Now I'm running Apache 2.4.6 on Ubuntu 12.04.

When I type in, for example, dhae.papertower.dev, it processes some scripts internally and moves me to www.dhae.papertower.dev.. and breaks. When I check my log, I find that it's trying to go to the /var/www/papertower/www directory.

I tried adding www.*.papertower.dev to the ServerAlias, but that didn't do it.

View 1 Replies


ADVERTISEMENT

MS Virtual PC - How To Access My Localhost (Apache) Subdomains On Guest OS?

Mar 23, 2007

I've just downloaded Microsoft Virtual PC and the Internet Explorer 6 Application Compatibility VPC Image containing an XP installation for testing sites with IE6 [url].

Everything works fine, I chose VPC Shared Networking (NAT) and I can access the internet from the VPC as well as my Apache development server which runs on the host OS (Win XP) by going to the host's IP address which is [url] in my case. And here I have 2 problems:

1. I want to access [url]on VPC just by typing [url]. I added the following line to the hosts file:

192.168.52.141 localhost

But this doesn't work. Interestingly, any name other than localhost works fine, for example:

192.168.52.141 localhost.localhost
or
192.168.52.141 local

This is not a major problem but I'd prefer localhost. Any ideas how to do that?

2. And the more important issue: on my host OS I have some development sites which I have set up to be accessed by subdomains, for example [url], in httpd.conf:

Code:
<VirtualHost 127.0.0.3>
ServerName perfekt.localhost
DocumentRoot C:wwwperfekt
DirectoryIndex index.php index.html
</VirtualHost>
and in hosts file:

Code:
127.0.0.3 perfekt perfekt.localhost
And now I want to access this site from my VPC too by using subdomains like this! How can I do that? The address 127.0.0.3 seems to be local to the OS and VPC can't see it. I have tried setting other IP addesses in httpd.conf but nothing outside the 127.x.x.x range works on either OS. I suppose I need to make each of my sites to be seen under a different IP from the outside network so that VPC (which is "outside" the host OS) can access them - then I just set up the appropriate subdomain names in VPC hosts file -

View 0 Replies View Related

Apache :: Setting Up Domains And Subdomains - Virtual Host

May 31, 2014

I am trying to set up domains and subdomains, on my webserver, however the domains are resolving, but when accessing a subdomain I get a 500 internal server error, permissions on files are the same on both domain and sub domain level.

My virtual host files looks like this for domains and for the subdomains, and I am using Apache 2.4.7, on an ubuntu 14.04 running on a rackspace cloud server.

Domains:

<virtualhost *:80>
ServerAdmin mail@mail.mail
ServerName domain.com
ServerAlias www.domain.com

[Code] ....

Why it works on domains, and not the subdomains?

View 1 Replies View Related

Apache :: Unable To Set Subdomains In 2.4

Apr 22, 2013

trying to find a working solution for setting up a subdomain for my Apache server.

Here is my setting:

(1) I have two virtual hosts defined in httpd-vhosts.conf: domain1.com and domain2.com. Included NameVirtualHost *:80 both into httpd-vhosts.conf and httpd.conf.

(2) Settings in httpd-vhosts.conf:

Quote:

# domain1.com virtual host.
ServerAdmin info@domain1.com
DocumentRoot "d:/Websites/domain1_com/www"
ServerName domain1.com:80
ServerAlias *.domain1.com

[Code] ....

So far, everything works perfectly.

(3) Now, I added a virtual host for subdomain:

Quote:

# sub.domain2.com virtual host.
ServerAdmin info@sub.domain2.com
DocumentRoot "d:/Websites/sub_domain2_com/www"
ServerName sub.domain2.com:80

[Code] ...

4) Here the problem comes. When I enter sub.domain2.com into browser, it shows domain1.com content.

(5) Based on some suggestions, I removed asterisks from ServerAlias lines. This made the subdomain working, but messed up the other two servers, which became unavailable or broken down.

View 8 Replies View Related

Apache :: Subdomains Served By Themselves?

Oct 12, 2013

When I type mail.mydomain.com into any browser it resolves to the first virtual host that my apache has even though there aren't any document roots defined for mail.mydomain.com. Apache itself works fine, mail server itself works fine as well. I thought that since mail.mydomain.com has an A record but does not have any document roots specified for that Apache simply takes the first virtual host it has on its list and shows it up online as mail.my domain.com. Is that not right? Is there perhaps any misconfiguration somewhere?

I tried deleting virtual hosts one by one and this test simply confirmed that in order to "serve" mail.mydomain.com Apache takes the first virtual host it has on the list. Then I created a document root for mail.mydomain.com and now it shows some test content I specified but my issue / question remains.. Does it mean that I have to create document root stuff for every single A record I have? For example I have an A record for mail. mydomain. com which works as a mail server but for some reason it also resolves as a simple web page?

The problem in short is that when I type mail.mydomain.com into a browser it shows the content from subdomain.mydomain.com. The relation to mail is not webmail, it's just a regular standard mail server. The question / goal is to find out whether it is supposed to be like that? If it is then I will have to create some content to be shown when someone types mail.mydomain.com

View 14 Replies View Related

Configuring Subdomains In Apache On A Localhost

Apr 27, 2006

I'm currently trying to configure apache 2 to handle subdomains. This is on a local machine (not tied to any domain names) and I'm only doing it to research how the final structure of a site 'could' be setup.

Basically I have a single install of Apache 2 running. The outcome eventually should be to have specific sub domains that all point to the same document root as the actual domain name. So eventually I will have:

http://www.mydomain.com
http://subdomain1.mydomain.com
http://subdomain2.mydomain.com

with both subdomains showing the content at mydomain.com (there is reasoning behind this but I'm not gonna go into that).

I have apache setup as follows:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName daneastley
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
</VirtualHost>


<VirtualHost *:80>
ServerName subdomain1.daneastley
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
</VirtualHost>

<VirtualHost *:80>
ServerName subdomain2.daneastley
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
</VirtualHost>

Now on my local machine, only the top one works - the subdomains dont. if I add the following into my hosts file in windows, they all work:
127.0.0.1 daneastley
127.0.0.1 subdomain1.daneastley
127.0.0.1 subdomain2.daneastley

the problem being, that I wish to test this enviroment on the local network. How would I go about having every computer being able to access this? I'm assuming it comes down to DNS stuff.

View 0 Replies View Related

Apache :: HTAccess Wildcard Subdomains

Jul 11, 2015

I have viewing the city names in my website like the following structure - [URL] ....

Here is the ,htaccess code - RewriteRule ^([^/]*)/([^/]*)/$ city.php?state=$1&city=$2 [NC]

But actually, I'm looking for to use wildcard subdomains that will rebuild the city names like the following structure-
city.mydomain.com/state/

I just need the htaccess rewrite code. 

View 1 Replies View Related

Apache :: Internal URL Rewrite Across Subdomains

Jun 8, 2013

I want to rewrite across subdomains, e.g. requests for sub1.mydomain.com/foo.htm -> www.mydomain.com/foo.htm. I can do

this with something like:

Code:
RewriteCond %{HTTP_HOST} ^sub[0-9].
RewriteRule (.*) http://www.mydomain.com/$1 [R=303,L]

I want to make it an internal rewrite though, not an external redirect. If I remove the [R=303] I still end up with a redirect (a 302). I assume mod_rewrite is forcing an external redirect because it's to a different [sub]domain.

Is there any way I can overcome this and make the change internal?

View 2 Replies View Related

Apache :: Redirecting All Subdomains To HTTPS

Jan 21, 2015

Say I have two domains: example.com and example.net.

Upon a http request to example.com, I wish to redirect to https://example.com.

Upon either a http or https request to example.net, I wish to redirect to https://example.com.

Note that for both cases, subdomains should also be redirected, and the change should be considered permanent.

I've seem multiple ways to do so. What is the best way? How do I deal with subdomains when there is a new domain such as example.net to example.com?

I've taken a stab. How to fill in the gaps?

View 1 Replies View Related

Subdomains Half-way Created And Ignored By Apache

May 27, 2015

Since a week ago or so, in one of our Plesk 12.0.18 / Centos 6.6 servers, when we create subdomains the process seems to stop half-way without being finished.

To reproduce the error:

Select a subscription (e.g. example.com) and go to "Domains and subdomains"
Select "add new subdomain" and enter a value (e.g. new.example.com). The directory will live in parallel to httpdocs
Click Accept

Expected result:

The subdomain should be created: Filesystem diirectory with default contents, DNS entry, Apache VirtualHost, etc.

Actual result:

After several minutes Plesk responds with Internal Errror (in a red area in the panel).

Things done right:

The file space in parallels with httpdocs is created fine with the default site.
DNS entries are created under /var/named/chroot infrastructure.
The subdomain menu appears fine in the Plesk panel.

Things wrong/missing:

The filesystem directory is not mapped by Apache. Even after changing its contents the default server templeate appears in the browser, (all precautions taken, apache restart, browser in private session and different browsers).

Log info:

- /var/log/sw-cp-server/error_log says:
2015/05/27 18:17:45 [error] 28890#0: *1828 readv() failed (104: Connection reset by peer) while reading upstream, client: nnn.nnn.nnn.nnn, server: , request: "POST /smb/web/add-subdomain HTTP/1.1", upstream: "fastcgi://unix:/var/run/sw-engine.sock:", host: "<hostname>:8443", referrer: "https://<host>:8443/smb/web/add-subdomain"

- /var/log/httpd/access_log records the access with 200 OK codes although I don't find them in neither subscription logs under /var/www/vhost/system/*/logs/access_log
nnn.nnn.nnn.nnn - - [27/May/2015:18:38:35 +0200] "GET <deleted_content_in_the_subdomain_directory> HTTP/1.1" 200 14036 "http://<new_subdomain>" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0

I don't find the Apache VirtualHost .conf files for subdomains, where can I look for them up...

View 4 Replies View Related

Apache :: VirtualHost - Configure Subdomains?

Jan 14, 2013

I have substituted the domain names and DocumentRoot folders for generic titles, so I will refer to those where applicable in the thread as well.

Here is my httpd-vhosts.conf:

<VirtualHost *:80>
DocumentRoot "C:WebServerwww"
</VirtualHost>
<VirtualHost *:80>

[Code] ....

View 1 Replies View Related

How Do I Rid Of The Generic Apache/cPanel Page When Subdomains Are Accessed

Aug 1, 2008

I just picked up a WiredTree VPS account, but have never really dabbled deep into server-related knowledge. I was wondering what one would do to rid of the "Great Success!

Apache is working on your cPanel® and WHM™ Server" pages when subdomains are accessed?

View 0 Replies View Related

Wildcard DNS Subdomains Working, But Existing Subdomains Not

May 7, 2007

I've set up the affiliate manager from jrox.com for a client of mine. This includes the setup of wildcard DNS so that each affiliate can have username.clientssite.com and have it count their clicks - which works properly.

What isn't working properly is that he also has forums.hissite.com, which is loading the main website page instead of his forums. He is using cpanel to add the subdomain, and it isn't failing, so I'm not sure what's going on with it.

Here is the relative section from the httpd file.

Quote:

<VirtualHost 74.53.106.146>
ServerAlias residualvictory.com
ServerAlias *.residualvictory.com
ServerAdmin webmaster@residualvictory.com
DocumentRoot /home/residual/public_html
BytesLog domlogs/residualvictory.com-bytes_log
ServerName www.residualvictory.com

User residual
Group residual
CustomLog /usr/local/apache/domlogs/residualvictory.com combined
ScriptAlias /cgi-bin/ /home/residual/public_html/cgi-bin/
</VirtualHost>

<VirtualHost 74.53.106.146>
ServerAlias www.forums.residualvictory.com
ServerAlias forums.residualvictory.com
ServerAdmin webmaster@forums.residualvictory.com
DocumentRoot /home/residual/public_html/forums
BytesLog domlogs/forums.residualvictory.com-bytes_log
ServerName forums.residualvictory.com

User residual
Group residual
CustomLog /usr/local/apache/domlogs/forums.residualvictory.com combined
ScriptAlias /cgi-bin/ /home/residual/public_html/forums/cgi-bin/
</VirtualHost>

And the bind file for his domain

Quote:

; Modified by Web Host Manager
; Zone File for residualvictory.com
$TTL 14400
@ 86400 IN SOA ns1.lucidic.com. root.lucid.lucidic.com. (
2007050705
86400
7200
3600000
86400
)

residualvictory.com. 86400 IN NS ns1.lucidic.com.
residualvictory.com. 86400 IN NS ns2.lucidic.com.


residualvictory.com. 14400 IN A 74.53.106.146

localhost.residualvictory.com. 14400 IN A 127.0.0.1

residualvictory.com. 14400 IN MX 0 residualvictory.com.

mail 14400 IN CNAME residualvictory.com.
www 14400 IN CNAME residualvictory.com.
ftp 14400 IN A 74.53.106.146
forums 14400 IN A 74.53.106.146
www.forums 14400 IN A 74.53.106.146
* 14400 IN A 74.53.106.146

View 10 Replies View Related

Apache :: Will Editing HTAccess File In Cpanel Effect All Wordpress Domains And Subdomains

Mar 26, 2014

I added the following to my cpanel .htaccess file on my hosting account:

<FilesMatch ".pdf$">header set x-robots-tag: noindex
</FilesMatch>

This was to stop Google from crawling and indexing my PDFs, will this work accross all my addon domains and subdomains (which are wordpress) on my hosting account or do I need to take extra measure?

View 4 Replies View Related

Apache Virtual Configuration

Sep 12, 2006

Someone had mentioned a way to use virtual apache configs, this way you wouldn't have to reboot apache each time you add a new domain to your box.
Can you tell me what dso I need to use?

Also is there a conversion tool to grab the configs you have now, and migrate them to the external files?

View 4 Replies View Related

Apache 2.0 Virtual Hosts

Oct 13, 2007

I just have a question about an Apache 2.0 error. I am running a web host and I am using VHCS for my web hosting control panel which creates virtual hosts in Apache's config files. Whenever I have a certain number of virtual hosts (200 or more roughly) Apache will start giving me problems with no messages about what went wrong. Some examples of what Apache does is that it will crash when I run "apache2ctl restart" or it just won't run when I start it sometimes. It really annoys me since I'm wondering if it's an Apache memory issue. Any ideas on what to do or how to solve this dilemma?

View 2 Replies View Related

About Apache Virtual Hosts

Nov 15, 2008

i bought some webspace and i have uploaded mywebsite.I need to configure my domain atomuss.com to have virtual hosts.How is that done?.I have tried contacting my webmaster and it seems he is making himself unavailable everytime i speak want a word with him.
Anybody..

View 5 Replies View Related

Apache Virtual Host

Jul 25, 2008

For some reason, the first virtual host i have listed in apache2.conf gets all the traffic of all the other virtual hosts listed below it.

Example: Domain xyz.com is listed as the first virtual host. the second, third, and fourth are 123.com, 987.com, and mno.com, respectively (fictitious domains). However, it seems that everything below xyz.com goes straight to xyz.com.

If i switch the first entry, xyz.com with any of the others, such as mno.com, so that mno.com is the first virtual host entry, everything then forwards to that domain.

View 0 Replies View Related

Apache :: Virtual Hosts Through SSH

Jan 12, 2013

I have a little trouble with my Apache configurations. I have two computers with Ubuntu and Apache 2.2 - let's call them Home (192.168.1.2) and Server (192.168.1.3) connected with a router. I am working on Home, connecting to Server via ssh and mounting the web root directory of Server to Home via sshfs -> Server's /var/www becomes Home's /home/username/www. The problem is I can't really setup my Apache virtual hosts. I have a project in Server's /var/www/project, respectively Home's /home/username/www/project, and I want to create a virtual host on Home that lets me view the remote contents.

This is what I am adding to Home's /etc/hosts: 192.168.1.3 project

This is what I am adding to Home's /etc/apache2/sites-available/project:

<VirtualHost 192.168.1.3:80>
DocumentRoot /home/username/www/project
ServerName project
</VirtualHost>

After all this, when I open http://project/ in Home's browser, I just see the default apache page of Server (the one in /var/www).

View 1 Replies View Related

Apache :: Two Virtual Hosts With Only One Using SSL

Oct 12, 2013

I am messing with Apache at home and have managed to create virtual hosts with no problems, my next step was to produce a self signed SSL cert. which again has worked but it's redirecting my non-SSL virtual host to the host I have set-up for SSL for example:

- www.mysite1.com set-up with SSL and works as designed both http and https
- www.mysite2.com I don't want using SSL is working fine through http but if you try https it will then redirect to www.mysite1.com

View 1 Replies View Related

Apache - Run Virtual Host As User

Jun 5, 2009

I've run into a wall trying to run apache with multiple websites allowing users to use FTPd to manage files.

I'm running FreeBSD 7.1 on Apache 2.2.x

The issue is that Apache runs as www:www but FTPd writes the files as username:client. When performing some scripts that edit back-end files, this obviously can cause errors.

The data for each directory is stored in /home/username/www

I looked into some apache directives I could use. I tried putting User and Group directives into the vhost configuration for each vhost, but that did not work. I even found the perchild module and it looked like it can do the job but was a bit scared and turned off by the fact that it states it is beta at the top of the page. (I cannot link to it because I do not have enough posts.)

View 2 Replies View Related

Apache Virtual Host, Can't Use Allowoverride

Jun 8, 2008

I have a virtual host and I want to allow .htaccess files to be used, but that requires to put allow override yes in the virtual host declairation as its off by default, but I get this error:

Starting httpd: Syntax error on line 16 of /etc/httpd/conf/virtualhosts.conf:
AllowOverride not allowed here

This completly ditches my whole virtual hosting idea that I've been planing for a while.

Any other way to allow .htaccess through virtual hosts?

using apache 2.2.3

View 4 Replies View Related

Apache ReverseProxy On Virtual Host

Nov 20, 2007

Today I configured a Virtual Host (VH) for one of my customers. VH run on WindowsServer 2003 Apache 2.0.59. I enabled mod_proxy and mod_proxy_http modules and successfully loaded. Here is the VH config:

Code:

<VirtualHost xxx.xxx.xxx.xxx:80>
ServerAdmin admin@example.com
ServerName www.example.com
DocumentRoot C:/Apache2/htdocs/www/example.com
DirectoryIndex index.php
<Proxy *>
Order Deny,Allow
Allow from all
</Proxy>
ProxyRequests Off
ProxyPass /cms-test [url]
ProxyPassReverse /cms-test [url]
ProxyPass /cms-eshop [url]
ProxyPassReverse /cms-eshop [url]
ErrorLog logs/www.example.com-error.log
CustomLog logs/www.example.com-access.log combined
</VirtualHost>
According stated above proxy should map the content of yyy.yyy.yyy.yyy:80 and send it to client... Apache doesn't do that but redirects client directly to yyy.yyy.yyy.yyy instead, even rewriting URL, what is not proper purpose of proxy. I would expect proxy to retrieve content from yyy.yyy.yyy.yyy:80 and forward it to client without URL rewriting. Rewriting URL and direct aiming of client to source of content is unsuccessfull of course, because the source (yyy.yyy.yyy.yyy:80) trust only to xxx.xxx.xxx.xxx which has a right to request a content.

Could anybody explain why proxy doesn't proxy and redirects instead?

View 2 Replies View Related

Setting Up Virtual Host In Apache

Mar 25, 2007

I'm trying to setup a subdomain, and this is what i've added in httpd.conf

<VirtualHost 000.000.000.000>
ServerName dir.domain.com
DocumentRoot /home/domain/html/dir/
</VirtualHost>

Am i missing something here? I restarted httpd when finished.. but it doesnt work.

View 3 Replies View Related

Win 2003 Apache 2.2 Virtual Ssl Hosts

Mar 30, 2007

I have been tearing my hair out over this, I have a small problem, I am trying to set up multiple virtual hosts using ssl on port 443. I have followed instructions and set up IP based hosts with my single network card having two different IP's. but the problem is that the second IP is not recieving any requests from the router as it is using the certificate from the first host and diverting to the result of the first sites authentication process.

any one know how I can do this, the first router forwards all requests to the second more secure router which then forwards to the server which is working fine. I need to get this to work and don't know how. both routers support NAT and ther servers first IP address has been assigned a NAT IP.

I can't include the conf file as the board won't let me until I have posted 5 times....but if you need it I can email it or something

the virtual hosts on port 80 are name based....does this matter?

View 0 Replies View Related

Apache :: Setup A Virtual Host

Aug 7, 2014

I have a fresh Ubuntu 14.04 install (desktop). I installed Apache, php and mysql from APT and updated everything.I tried to setup a virtual host using these directions: URL...I followed them to the letter:

o I created a folder /var/www/mydomain.local/public_html
o I copied the 000-default.conf in sites available and modified it
o I added mydomain.local to my hosts file (with IP of 127.0.0.1
o I used a2ensite to enable the host
o I used service apache2 reload

When I went to mydomain.local in firefox, it took me to the default host main page.I tried a restart of the service and even a reboot of the computer. No change.On a theory, I used a2dissite to remote 000-default from the enabled site list and reloaded the service. I got the home page for mydomain.local after that.

I created a named host called localhost and reloaded the apache. When I went to http://localhost it took me to the mydomain.local homepage. Rebooted the computer. Now, localhost gives me the apache default home page and mydomain.local does not work at all (I get a server not found).

I get the feeling that there is an apache configuration item I am missing but I cannot find it.

View 1 Replies View Related

Apache :: How To Ajp Redirect In Virtual Host

May 1, 2014

I have a server server.SERVER.com which ajp-redirects /app to port 8009 in httpd.conf as

View 7 Replies View Related

Apache 2.2 Windows Virtual Hosts

Jun 24, 2013

Ok so I just installed apache 2.2 on windows server 2008.

I would like to set it up so if I go to 99.144.79.25(Server IP) I get index1.html. If I go to example.com which points to 99.144.79.25 I get index2.html. If I go to example3.com which points to 99.144.79.25 I get index3.html.

So kind of like, if the domain folder is not found on my server, give the page index1.html.

In the long run I want to run a bunch of sites with different domains, testing right now though. 

View 1 Replies View Related

Apache Virtual Host Work On 80 But Not Over 443

Apr 18, 2013

OS: RHEL 6.4
SELinux: permissive mode
Apache: 2.2, mod_fcgid, mod_suxec, mod_ssl enabled
Common Name: [URL] .....

View 7 Replies View Related

Ubuntu + Apache + Virtual Host + Subversion

May 11, 2009

i have followed twice a tutorial (you'll find it if you type in google "sellersrank ubuntu subversion". It is the second result. You know, I cant insert URL in my posts yet...) to install Ubuntu + Apache + Virtual host + Subversion, but when i try to access the repository through "svn.domain.com" an error message like this is showed:

Address Not Found
Firefox can’t find the server at svn.domain.com.

I have Ubuntu 8.04 + Apache 2.2.8

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved