Subdomains on WampServer - apache

I'm working on WampServer for development, I've set up the domain tuniguide.local It works fine with this configuration:
DocumentRoot "D:\www\tuniguide"
ServerName tuniguide.local
But when I wanted to add a subdomain fr.tuniguide.local I get a 404 Not Found with this configuration:
DocumentRoot "D:\www\tuniguide\fr"
ServerName fr.tuniguide.local
It gives me this message:
The requested URL /www/tuniguide/index.php was not found on this server.
Is there someting that I missed?
Thanks.

You may need to edit your host file on your server machine to have it point the correct domains to your localhost. Check out this in depth tutorial on subdomains for Wamp here: http://www.itutorblog.com/2011/06/how-to-create-a-subdomain-on-wamp/

Related

Subdomains with Apache Virtualhost

I have a server and registered a domain - say mysite.com - that is pointing to the IP address of the server. I tested the setup with a django project in the default.conf file. This works without a flaw, but my goal is to move this django site to a subdomain. As this didn't work as expected, I tried to get a minimal example working with a redirect.
This is what I have:
sites-available/sub.conf
<VirtualHost *:80>
ServerName sub.mysite.com
RedirectPermanent / https://google.com/
</VirtualHost>
I enabled the site via a2ensite sub and service apache2 reload. When visiting sub.mysite.com all get is
Server not found
What am I missing?

mediawiki instance served by apache on specific domain

So, I use MediaWiki, hosted by Apache (wiki dir is in /var/www/html/wiki).
I have my domain www.my-domain.com which is redirected through apache virtual host to port 8080 for some nodejs app.
I have now tried to set up my wiki to be served on http://wiki.my-domain.com
In my DNS records i have both www and wiki domains redirected to same server.
First I tried to make apache virtual host to handle domain request:
<VirtualHost *:80>
ServerAdmin webmaster#localhost
ServerName my-domain.com
ServerAlias wiki.my-domain.com
DocumentRoot /var/www/html/wiki
</VirtualHost>
However if I tried to connect to wiki.my-domain.com or wiki.my-domain.com/wiki I got the message that the page doesn't exists.
I went to check my wiki's LocalSetting.php
and I tried editing this line:
## If i changed value to this, it didn't worked
$wgServer = "http://wiki.my-domain.com";
## If i set value to this, it was working
$wgServer = "http://my-server-IP";
However, if i set wgServer to my server IP, whenever i write http://wiki.my-domain.com, i get redirected to http://my-IP/wiki instead of staying on domain name
I would appreciate the help on how to properly set up my wiki's or apache's settings to properly host my wiki on my domain.
I found the problem:
$wgScript was set to:
$wgScript="/wiki"
and needs to be set to:
$wgScript=""
since Apache was redirecting the domain already to my /wiki folder, there was no need for script to also redirect it there and this was causing problems.

Cannot access to my server without writing the client's host

I have set up my OVH server, installing apache2, php5, mysql, phpmyadmin etc... And configured the vhosts.
The content of my VirtualHost file :
<VirtualHost *:80>
ServerName www.abracadabook.fr
ServerAlias abracadabook.fr *.abracadabook.fr
DocumentRoot /home/abracadabook/www/
<Directory /home/abracadabook/www/>
Options -Indexes
AllowOverride All
</Directory>
</VirtualHost>
When I type the ip address of my server, it displays the apache default page. But after setting up my windows hosts file (I'm on windows but the server's on linux), when I try accessing abracadabook.fr the site is loaded and the root directory is right (/home/abracadabook/www) and it displays the normal index of my website. But the problem is that the site is not accessible from another client machine.
When I try to access to it from a PC which host file is not set up, nothing will load even when I access it with the ip address.
I searched in many boards and forum but never found the solution.
I hope you can help me.
Regardly,
(PS Sorry for my bad english)
Turns out I had not the good informations.
I followed this tutorial step by step and it works well now.
Kimsufi DNS setting Tutorial (French)

My localhost apache server isn't showing my index.html

Recently, my localhost apache server stopped showing my index.html. It just shows "It works!" now. I'm not sure what to do. My httpd.conf file looks fine, but this is it:
http://pastebin.com/JQSEMUTy
and when I attempt to restart my apache server it gives:
httpd: Could not reliably determine the server's fully qualified domain name, using Richard-Lus-MacBook-Pro.local for ServerName
Thanks in advance!
I guess there was an update..?
DocumentRoot "/sites"
is this the document root you are using? If not, fix it. Also, set your servername:
ServerName www.example.com:80

Redirecting an internal path to a virtual host

I have been working on a drupal test site for a while, which has a bunch of virtual hosts set up like this:
<VirtualHost *:80>
ServerAdmin email#example.com
DocumentRoot "/path/to/root"
ServerName testsite1.example.com
</VirtualHost>
I have been using a modified host file to view each of these test sites, along the lines of:
12.0.0.1 localhost
20.02.2.22 testsite1.example.com
20.02.2.22 testsite2.example.com
20.02.2.22 testsite3.example.com
This has worked fine, however now I need to send the sites over to some people remotely who are not technical enough to modify their own host files and see it the way I do.
Is there a way I could set up Apache so that the url "http://20.02.2.22/testsite1" would forward to testsite1.example.com internally? I am using Drupal, and the site setup needs to see the "testsite1.example.com" so that it can correctly choose the instance to select. I have been looking through apache rewrite, but I am a bit of a newb at this so any help is much appreciated.
testsite1.example.com will only be resolved on your machine, so you cannot redirect. You can set up proxy with mod_proxy. Hope this works for you:
<VirtualHost *:80>
ServerAdmin email#example.com
DocumentRoot "/path/to/root"
ServerName testsite1.example.com
ServerAlias 20.02.2.22
<Location /testsite1/>
ProxyPass http://testsite1.example.com/
</Location>
</VirtualHost>
The way I show my local test sites is a combination of Dynamic DNS and port-forwarding.
Internally, my Drupal site is at [my machine ip] or localhost.
I setup a free dynamic dns name to my IP and then on my router, accept incoming requests on port to route to [my machine ip]
That way, they can see yoursite.dyndns.com, but its looking at your local copy.
Why you just don't buy a new domain name and point it to your server IP address...
Or there are free domain solutions like:
http://www.dot.tk/en/index.html?lang=en
or
http://dyn.com/dns/
If you wanna buy new domain, i recommending you this one, cheap and quality service: http://server2.elite7hackers.us/recommend.php?site=godaddy