Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: apache php problem

  1. #1
    Join Date
    Aug 2013
    Beans
    46

    apache php problem

    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.

  2. #2
    Join Date
    Aug 2013
    Beans
    46

    Re: apache php problem

    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

  3. #3
    Join Date
    Jun 2014
    Beans
    7,375

    Re: apache php problem

    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:


  4. #4
    Join Date
    Aug 2013
    Beans
    46

    Re: apache php problem

    at the moment when i use the ip i get same as when i use the domain

    This 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]
    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_html
    Last edited by joe672; October 15th, 2021 at 12:55 PM.

  5. #5
    Join Date
    Aug 2013
    Beans
    46

    Re: apache php problem

    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.

  6. #6
    Join Date
    Aug 2013
    Beans
    46

    Re: apache php problem

    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

  7. #7
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: apache php problem

    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

  8. #8
    Join Date
    Aug 2013
    Beans
    46

    Re: apache php problem

    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

  9. #9
    Join Date
    Aug 2013
    Beans
    46

    Re: apache php problem

    Time for a virtual fire for this setup lol

    cant get a connection between the domains and the server no matter what

  10. #10
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: apache php problem

    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.com
    Code:
    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...

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •