ive installed ubuntu 20.04. apache is installed, it displays the test html page once setup on the virtual host and also the test php pagr but it wont load any of my sites in var/www/html. some are php and some html. any helps appreciated
ive installed ubuntu 20.04. apache is installed, it displays the test html page once setup on the virtual host and also the test php pagr but it wont load any of my sites in var/www/html. some are php and some html. any helps appreciated
Last edited by joe672; October 15th, 2021 at 03:24 AM.
the test html page loaded when i added the ip to server name in the virtual host. but when i try that with any of my sites, nothing works , same with the domain names
You should have an index.html page in /var/www/html. Your statement that nothing works isn't very helpful. What exactly does happen when you open your browser and in the address bar you type:
at the moment when i use the ip i get same as when i use the domain
when i setup a test config in sites available/enabled and var/www/html/testsite.html and using the server name as the ip, the test page loads. when i use it for any of my other sites in var/www/html/sitename/ nothing loads . my sites used to be in home/site/public_html before but i read 20.04 must use var/www/html/site/public_htmlThis site can’t be reached
Check if there is a typo in www..
- If spelling is correct, try running windows network Diagnostics.
[COLOR=var(--error-code-color)]DNS_PROBE_FINISHED_NXDOMAIN[/COLOR]
Last edited by joe672; October 15th, 2021 at 12:55 PM.
a wild guess: if ive setup custom name servers for my domain with my old host to point to new, do i need to edit resolv.conf ?
Last edited by joe672; October 15th, 2021 at 01:48 PM.
root@localhost:~# host mysite.com
Host mysite.com not found: 2(SERVFAIL)
root@localhost:~# host myothersite.co.uk
myothersite.co.uk has address 77............
the difference between the two is how the name servers are setup, one has custom name servers setup on old host still pointing to ip, the .co.uk domain was moved to a new host and uses A record with domain and the hosts name servers. It still doesnt display when url is used
Apache determines which virtual host to use by matching the requested name to the value of the ServerName field in every <VirtualHost></VirtualHost> stanza. If it finds no matches, it uses the default page.
You can use a ServerAlias declaration in the VirtualHost definition specifying other names to which that definition applies.
Code:<VirtualHost> ServerName www.example.com ServerAlias example.com [stuff] </VirtualHost>
Last edited by SeijiSensei; October 15th, 2021 at 04:37 PM.
If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.
Blog · Linode System Administration Guides · Android Apps for Ubuntu Users
here is one of my sites-enabled conf
Code:<VirtualHost 77...:80> ServerAdmin joe@.com ServerName www..com ServerAlias www..com DocumentRoot /var/www/html/.com/public_html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> thanks
Time for a virtual fire for this setup lol
cant get a connection between the domains and the server no matter what
Have you got DNS updated with the correct IP for the domain name you are trying to hit?
If you are trying to connect to www.example.com and there is no DNS entry for it, the traffic will go nowhere - so it won't hit Apache at all.
You can verify this by either ping or using dig.
Code:ping www.example.comCode:dig www.example.com
Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide
Tomorrow's an illusion and yesterday's a dream, today is a solution...
Bookmarks