How to point a domain name to a specific virtual host in WAMP VPS Server - apache

I have wamp VPS server that contains two websites:
first one active and it's domain is pointing to it (the previos developer had made it)
second one not active yet (I had made it)
how to make sure that my new website's domain will point to it (I had made an A recored pointing to the server IP)?
when i made the virtual host for my website i should type localhost/mywebsite.com to show it is it relates to that i hadn,t restart the apache server after configuring the virtual host.
i had made an A recored pointing to Server's IP Adress

Related

How to remotly access a custom wampserver's virtual host in a local network?

I use Wampserver 3.0.6 under windows 10 and I want to share my application between my personal PC (The host) and some other computers linked to the same home network (Clients).
I changed a line on httpd-vhosts.conf file to let the application be accessible from other machines in the network from this:
Require lacal
to this:
Require all granted
The problem is that the default virtual host (localhost) is accessible from those clients using the host's ip adress like this 192.168.###.###/ but not my customized virtualhost (tilelli on this case). Here is the content of httpd-vhosts.conf file now:
enter image description here
I tried to access it via 192.168.###.###/tilelli/ and directly via tilelli/ but didn't work.
Can anybody help me please ?
If you define a Virtual Host Servername as tilelli then Apache will serve that site when it sees that domain name in the connection request i.e. http://tilelli.
If you have a local (company) DNS Server, add that domain to it, pointing to your WAMPServers PC's IP Address. If you dont have a local DNS Server, then change the HOSTS file on the PC's that need to see this server so they know where to look for it
HOSTS FILE
192.168.xxx.yyy tilelli
You do have to change each and every one of the other PC unfortunately.

DNS entry for third level domain

I am trying to create a third-level domain virtual host on my server. I hope the configs are set up correctly, but I am getting a ERR_NAME_NOT_RESOLVED error.
I have read that I have to "add DNS entry" somewhere so that the name would get resolved, but how do I do that? Where do I do that? The server is running on Ubuntu .
I suppose you get that ERR_NAME_NOT_RESOLVED error from Chrome. This means that Chrome is unable to find the subdomain in DNS.
You are correct, registering your subdomain in DNS will require DNS changes. Specifically, you have to add a DNS A resource record for your subdomain to become "visible" to browsers over IPv4. For IPv6, add an AAAA, too. Both record types point to an IP address and it will be the IP address of your web server. (Technically, you can also use a CNAME type record, but make sure to read up on how that works.)
Subdomain DNS will be served by the authoritative DNS servers for your domain, so you can register the required record(s) through your DNS service provider. If you are not sure who they are, look up the NS records for your domain, this will give you the list of authoritative name servers for your domain and you can work from there.
I understand you have already configured your Apache to work with the subdomain, so setting up DNS completes the setup process.

website can be accessed using ip but not with the url(domain name) in wamp

from default httpd.conf to updating the host file and httpd.conf i tried but the website fails to open with domain name give
in host file
<my current public ip address> <domain name>
in httpd.conf
Listen [my public ip]:port
then restart of wamp server and finally restart of PC and of-course change of ip is done in above all.
But of no use
Please help
Thanks for time and response
Aaron,
I think you are misunderstanding the function of the HOSTS file.
The hosts file acts a little like a local DNS Server. Any changes you make to it will only effect the single PC that you made the change on.
What the HOST file actually does
When windows starts it starts a service called DNS Client also known as dnscache. That service reads the HOSTS file and seeds the dnscache with any domain names you put in it and the ip that should be connected to for each domain name.
Any program (the browser in this case) that wants to connect to a domain, checks this cache first, to reduce accesses to an actual DNS Server out on the web and therefore speed up the conversion of domain name to Ip Address.
So if you want external users, i.e. anybody on the internet to be able to access your site you have to either purchase a real domain name and get it pointed to your WAN ip address, or use a Dynamic DNS service like DYNDNS or NO-IP, to mention only a few, and get that dynamic dns service to point to your WAN IP.
You will also have to change your Apache config so it will serve that domain name, my suggestion would be to create a Virtual Host to do this.
This post may help with the process of creating a Virtual Host

Apache not able to access document root when outside the network

I have a wordpress site on my debian server. I have done the port forwarding successfully (verified this) to access outside the network. However I get the below error when i try to access outside the network. Am i missing something? Sites-available is set to documentroot at /var/www, which is where my wordpress folder is.
The requested URL /XXXXXX was not found on this server.
Apache/2.2.22 (Debian) Server at 10.1.1.4 Port 80
I really hope someone can help me on this as i have spent almost a week over this.
Thanks!
I do this kind of stuff on daily basis. Lets go through the basics.
Firstly, confirm that you can access your server within your private network http://yourserverLANip:80
If possible, do not use server itself to test it (eg localhost:80), use other device as laptop or any other device within the same LAN.
With that test you can confirm that:
apache listens on port 80
apache accepts requests from other clients within your private network
wordpress is set up correctly
If wordpress site pops up we can assume that apache and private network configuration is correct and you'd need to move your debugging to WAN/public network configuration.
It would be wise to recheck apache security settings at this point.
From here, things get a little more complicated.
I believe you mean public WWW when you say "outside-the-network". You want to make your site public to every internet user on the planet.
I assume that you have a registered domain name (eg yourwebsitename.com) and a static public IP address at the location where the server is located (if you host it at home, static IP is fixed to your modem).
These two are "must", if you want to host anything that public can consume.
If you host your apache for yourself, you dont need your domain name, but you'd need to access your server through your public IP yourpublicIP:80 and it's not easy to use for other people.
Now lets go on with WAN debugging.
Validate that:
your domain DNS WWW settings are pointing to your public IP address
at your server location. you can do it through the control panel of
your domain registrant company.
you have a static public IP address where your server is hosted
your modem accepts incoming ports (80). this is done through modem
firewall settings.
that the port 80 is redirected to your server private IP address (LAN
ip).
The flow for redirecting clients to your server is something like that:
Client->WWW->internet service provider->yourpublicIP->modem->yourserver at LAN
Good hunting!

apache virtual host question

After i 've set a virtual host in httpd.conf,
why i still have to set the virtual host in domain registration organization?
I'clarify
for example , i've set phpmyadmin.mydomain.com as virtual host in httpd conf file, next, i've to go to http://www.dyndns.com/ to add phpmyadmin.mydomain.com as A record, so phpmyadmin.mydomain.com will be accessible.
After i 've set a virtual host in httpd.conf,
why i still have to set the virtual host in domain registration organization?
These are two separate tasks because they touch entirely different areas.
DNS records tell the world that domain A is now reachable on IP address B (Imperfect real world analogy: an entry in the phone book)
The VirtualHost directive tells the server software running on the server how to deal with incoming requests to that domain. (Imperfect real world analogy: Your name on the doorbell of a large house, and on your mail box in the hallway of the house.)