unable to browse the server throught apache












0















I am using apache server I typed everything is correct, but when I tried to browse the apache server through by applying server IP address. it's showing 404 not found. I don't know where I type wrong please help me.



step 1:-



[root@server httpd]# ll
total 16
-rw-r--r--. 1 root root 0 Mar 7 13:06 access_log
-rw-r--r--. 1 root root 203 Mar 10 23:39 apachi1
-rw-r--r--. 1 root root 0 Mar 10 23:35 apachi1-error_log
-rw-r--r--. 1 root root 0 Mar 10 23:31 apachi2
-rw-r--r--. 1 root root 0 Mar 10 11:39 e1-error_log
-rw-r--r--. 1 root root 4444 Mar 10 23:35 error_log
-rw-r--r--. 1 root root 0 Mar 10 23:35 ssl_access_log
-rw-r--r--. 1 root root 356 Mar 10 23:35 ssl_error_log
-rw-r--r--. 1 root root 0 Mar 10 23:35 ssl_request_log


step 2:-



[root@server ~]# cd /var/www/html/
[root@server html]# ll
total 12
-rw-r--r--. 1 root root 48 Mar 10 23:33 home3.com
-rw-r--r--. 1 root root 35 Mar 10 11:37 host.com
-rw-r--r--. 1 root root 146 Mar 7 13:10 index.html


step 3:- under this config file I write this virtual host



[root@server ~]# cat /etc/httpd/conf/httpd.conf
<VirtualHOst *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/home3.com
ServerName 192.168.37.132
ErrorLog /var/log/httpd/apachi1-error_log
CustomLog /var/log/httpd/apachi1 combined
</VirtualHost>


My IP address is also correct when I tried accessing it with CURL



[root@server ~]# curl http://192.168.37.132
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL / was not found on this server.</p>
</body></html>









share|improve this question









New contributor




dhanush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    I guess this is PHP. Please share the sample code you are trying to run and also any errors that may arise. You can run in terminal tail -f /var/log/apache2/*.log the refresh the page. Edit your question and share the output with us.

    – Parto
    Mar 10 at 17:55
















0















I am using apache server I typed everything is correct, but when I tried to browse the apache server through by applying server IP address. it's showing 404 not found. I don't know where I type wrong please help me.



step 1:-



[root@server httpd]# ll
total 16
-rw-r--r--. 1 root root 0 Mar 7 13:06 access_log
-rw-r--r--. 1 root root 203 Mar 10 23:39 apachi1
-rw-r--r--. 1 root root 0 Mar 10 23:35 apachi1-error_log
-rw-r--r--. 1 root root 0 Mar 10 23:31 apachi2
-rw-r--r--. 1 root root 0 Mar 10 11:39 e1-error_log
-rw-r--r--. 1 root root 4444 Mar 10 23:35 error_log
-rw-r--r--. 1 root root 0 Mar 10 23:35 ssl_access_log
-rw-r--r--. 1 root root 356 Mar 10 23:35 ssl_error_log
-rw-r--r--. 1 root root 0 Mar 10 23:35 ssl_request_log


step 2:-



[root@server ~]# cd /var/www/html/
[root@server html]# ll
total 12
-rw-r--r--. 1 root root 48 Mar 10 23:33 home3.com
-rw-r--r--. 1 root root 35 Mar 10 11:37 host.com
-rw-r--r--. 1 root root 146 Mar 7 13:10 index.html


step 3:- under this config file I write this virtual host



[root@server ~]# cat /etc/httpd/conf/httpd.conf
<VirtualHOst *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/home3.com
ServerName 192.168.37.132
ErrorLog /var/log/httpd/apachi1-error_log
CustomLog /var/log/httpd/apachi1 combined
</VirtualHost>


My IP address is also correct when I tried accessing it with CURL



[root@server ~]# curl http://192.168.37.132
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL / was not found on this server.</p>
</body></html>









share|improve this question









New contributor




dhanush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    I guess this is PHP. Please share the sample code you are trying to run and also any errors that may arise. You can run in terminal tail -f /var/log/apache2/*.log the refresh the page. Edit your question and share the output with us.

    – Parto
    Mar 10 at 17:55














0












0








0








I am using apache server I typed everything is correct, but when I tried to browse the apache server through by applying server IP address. it's showing 404 not found. I don't know where I type wrong please help me.



step 1:-



[root@server httpd]# ll
total 16
-rw-r--r--. 1 root root 0 Mar 7 13:06 access_log
-rw-r--r--. 1 root root 203 Mar 10 23:39 apachi1
-rw-r--r--. 1 root root 0 Mar 10 23:35 apachi1-error_log
-rw-r--r--. 1 root root 0 Mar 10 23:31 apachi2
-rw-r--r--. 1 root root 0 Mar 10 11:39 e1-error_log
-rw-r--r--. 1 root root 4444 Mar 10 23:35 error_log
-rw-r--r--. 1 root root 0 Mar 10 23:35 ssl_access_log
-rw-r--r--. 1 root root 356 Mar 10 23:35 ssl_error_log
-rw-r--r--. 1 root root 0 Mar 10 23:35 ssl_request_log


step 2:-



[root@server ~]# cd /var/www/html/
[root@server html]# ll
total 12
-rw-r--r--. 1 root root 48 Mar 10 23:33 home3.com
-rw-r--r--. 1 root root 35 Mar 10 11:37 host.com
-rw-r--r--. 1 root root 146 Mar 7 13:10 index.html


step 3:- under this config file I write this virtual host



[root@server ~]# cat /etc/httpd/conf/httpd.conf
<VirtualHOst *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/home3.com
ServerName 192.168.37.132
ErrorLog /var/log/httpd/apachi1-error_log
CustomLog /var/log/httpd/apachi1 combined
</VirtualHost>


My IP address is also correct when I tried accessing it with CURL



[root@server ~]# curl http://192.168.37.132
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL / was not found on this server.</p>
</body></html>









share|improve this question









New contributor




dhanush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I am using apache server I typed everything is correct, but when I tried to browse the apache server through by applying server IP address. it's showing 404 not found. I don't know where I type wrong please help me.



step 1:-



[root@server httpd]# ll
total 16
-rw-r--r--. 1 root root 0 Mar 7 13:06 access_log
-rw-r--r--. 1 root root 203 Mar 10 23:39 apachi1
-rw-r--r--. 1 root root 0 Mar 10 23:35 apachi1-error_log
-rw-r--r--. 1 root root 0 Mar 10 23:31 apachi2
-rw-r--r--. 1 root root 0 Mar 10 11:39 e1-error_log
-rw-r--r--. 1 root root 4444 Mar 10 23:35 error_log
-rw-r--r--. 1 root root 0 Mar 10 23:35 ssl_access_log
-rw-r--r--. 1 root root 356 Mar 10 23:35 ssl_error_log
-rw-r--r--. 1 root root 0 Mar 10 23:35 ssl_request_log


step 2:-



[root@server ~]# cd /var/www/html/
[root@server html]# ll
total 12
-rw-r--r--. 1 root root 48 Mar 10 23:33 home3.com
-rw-r--r--. 1 root root 35 Mar 10 11:37 host.com
-rw-r--r--. 1 root root 146 Mar 7 13:10 index.html


step 3:- under this config file I write this virtual host



[root@server ~]# cat /etc/httpd/conf/httpd.conf
<VirtualHOst *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/home3.com
ServerName 192.168.37.132
ErrorLog /var/log/httpd/apachi1-error_log
CustomLog /var/log/httpd/apachi1 combined
</VirtualHost>


My IP address is also correct when I tried accessing it with CURL



[root@server ~]# curl http://192.168.37.132
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL / was not found on this server.</p>
</body></html>






apache2






share|improve this question









New contributor




dhanush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




dhanush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Mar 11 at 8:24









Dan

7,10934573




7,10934573






New contributor




dhanush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Mar 10 at 17:52









dhanushdhanush

32




32




New contributor




dhanush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





dhanush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






dhanush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 1





    I guess this is PHP. Please share the sample code you are trying to run and also any errors that may arise. You can run in terminal tail -f /var/log/apache2/*.log the refresh the page. Edit your question and share the output with us.

    – Parto
    Mar 10 at 17:55














  • 1





    I guess this is PHP. Please share the sample code you are trying to run and also any errors that may arise. You can run in terminal tail -f /var/log/apache2/*.log the refresh the page. Edit your question and share the output with us.

    – Parto
    Mar 10 at 17:55








1




1





I guess this is PHP. Please share the sample code you are trying to run and also any errors that may arise. You can run in terminal tail -f /var/log/apache2/*.log the refresh the page. Edit your question and share the output with us.

– Parto
Mar 10 at 17:55





I guess this is PHP. Please share the sample code you are trying to run and also any errors that may arise. You can run in terminal tail -f /var/log/apache2/*.log the refresh the page. Edit your question and share the output with us.

– Parto
Mar 10 at 17:55










1 Answer
1






active

oldest

votes


















0














From the ll command you posted, it seems that home3.com is a file, and not a directory.



While the DocumentRoot directive is /var/www/html/home3.com.



So when accessing that IP, Apache is trying to load /var/www/html/home3.com/index.html which does not exist, hence the 404 error.



You need to change the DocumentRoot directive to /var/www/html, and access the page with http://192.168.37.132/home3.com instead. Or make home3.com a directory, and create an index file inside that directory.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });






    dhanush is a new contributor. Be nice, and check out our Code of Conduct.










    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1124576%2funable-to-browse-the-server-throught-apache%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    From the ll command you posted, it seems that home3.com is a file, and not a directory.



    While the DocumentRoot directive is /var/www/html/home3.com.



    So when accessing that IP, Apache is trying to load /var/www/html/home3.com/index.html which does not exist, hence the 404 error.



    You need to change the DocumentRoot directive to /var/www/html, and access the page with http://192.168.37.132/home3.com instead. Or make home3.com a directory, and create an index file inside that directory.






    share|improve this answer




























      0














      From the ll command you posted, it seems that home3.com is a file, and not a directory.



      While the DocumentRoot directive is /var/www/html/home3.com.



      So when accessing that IP, Apache is trying to load /var/www/html/home3.com/index.html which does not exist, hence the 404 error.



      You need to change the DocumentRoot directive to /var/www/html, and access the page with http://192.168.37.132/home3.com instead. Or make home3.com a directory, and create an index file inside that directory.






      share|improve this answer


























        0












        0








        0







        From the ll command you posted, it seems that home3.com is a file, and not a directory.



        While the DocumentRoot directive is /var/www/html/home3.com.



        So when accessing that IP, Apache is trying to load /var/www/html/home3.com/index.html which does not exist, hence the 404 error.



        You need to change the DocumentRoot directive to /var/www/html, and access the page with http://192.168.37.132/home3.com instead. Or make home3.com a directory, and create an index file inside that directory.






        share|improve this answer













        From the ll command you posted, it seems that home3.com is a file, and not a directory.



        While the DocumentRoot directive is /var/www/html/home3.com.



        So when accessing that IP, Apache is trying to load /var/www/html/home3.com/index.html which does not exist, hence the 404 error.



        You need to change the DocumentRoot directive to /var/www/html, and access the page with http://192.168.37.132/home3.com instead. Or make home3.com a directory, and create an index file inside that directory.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 11 at 10:11









        DanDan

        7,10934573




        7,10934573






















            dhanush is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            dhanush is a new contributor. Be nice, and check out our Code of Conduct.













            dhanush is a new contributor. Be nice, and check out our Code of Conduct.












            dhanush is a new contributor. Be nice, and check out our Code of Conduct.
















            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1124576%2funable-to-browse-the-server-throught-apache%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            數位音樂下載

            When can things happen in Etherscan, such as the picture below?

            格利澤436b