forbidden error

Discussion in 'Installation/Configuration' started by rajchd, Jul 9, 2010.

  1. rajchd

    rajchd New Member

    I have installed ubuntu 10.04 on a computer as per instructions given on this link http://www.howtoforge.com/perfect-server-ubuntu-10.04-lucid-lynx-ispconfig-2 and everything went on smoothly. I am intending to use this server as intranet server for developing php sites as well as training sites for internal users.

    Though when I configure a site using ispconfig3, It creates the site but shows error 403, forbidden, when I try to navigate to that site. Though I can ftp and upload files to this site.
     
  2. falko

    falko Super Moderator Howtoforge Staff

  3. rajchd

    rajchd New Member

  4. falko

    falko Super Moderator Howtoforge Staff

    Any errors in Apache's error log?
     
  5. rajchd

    rajchd New Member

    error log

    Here is the copy of log file for 12th July located at /var/log/apache2/error.log.

    Code:
    [Mon Jul 12 11:33:44 2010] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
    PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/imagick.ini on line 1 in Unknown on line 0
    PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/imap.ini on line 1 in Unknown on line 0
    PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/mcrypt.ini on line 1 in Unknown on line 0
    [Mon Jul 12 11:33:44 2010] [notice] Apache/2.2.14 (Ubuntu) mod_fcgid/2.3.4 PHP/5.3.2-1ubuntu4.2 with Suhosin-Patch mod_ssl/2.2.14 OpenSSL/0.9.8k configured -- resuming normal operations
    [Mon Jul 12 11:36:42 2010] [error] [client 192.168.100.103] File does not exist: /var/www/favicon.ico
    [Mon Jul 12 11:36:50 2010] [error] [client 192.168.100.103] client denied by server configuration: /var/www/learn.it/test.php
    [Mon Jul 12 11:37:23 2010] [error] [client 192.168.100.103] client denied by server configuration: /var/www/learn.it/test.php
    
     
  6. rajchd

    rajchd New Member

    Solved

    Ok, thanks to this post, I was able to resolve this issue by changing /etc/apache2/sites-enabled/learn.it.vhost

    Code:
    <Directory /var/www/learn.it>
        AllowOverride None
        Order Deny,Allow
        Allow from all
    </Directory>
    
     
  7. rajchd

    rajchd New Member

    Not 100% solved

    Well, I was excited to see the directory listing after applying above solution that I posted success messages without testing all functionality.

    Now, when I go to url http://192.168.100.250/learn.it, browser displays the directory listing instead of showing up the default welcome screen of ispconfig. This default screen is shown up when I click on the web folder in the directory listing. Some mapping issue ?
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Wha you just did is that you opened up your server for hackers by allowing access to private directories which may contain passwords and other security related information. So remove the lines that you added.

    Your problem is that you uploaded the file into the wrong directory. All php and html files have to be uploaded into the "web" directory.

    wrong path:

    /var/www/learn.it/test.php

    Correct path:

    /var/www/learn.it/web/test.php
     
  9. rajchd

    rajchd New Member

    Thanks for security warning

    Thanks for the security warning, I have reverted the changes. Though problem is not solved yet for me.

    My files are in the /var/www/learn.it/web directory. I am not able to view any of these in the browser.

    Again attaching warning msgs and directory structure for learn.it

    Code:
    root@ubuntu:/var/www/learn.it# /etc/init.d/apache2 restart
     * Restarting web server apache2                                                                                                        [Mon Jul 12 16:11:42 2010] [warn] NameVirtualHost 192.168.100.250:80 has no VirtualHosts
    [Mon Jul 12 16:11:42 2010] [warn] NameVirtualHost 192.168.100.250:443 has no VirtualHosts
     ... waiting [Mon Jul 12 16:11:43 2010] [warn] NameVirtualHost 192.168.100.250:80 has no VirtualHosts
    [Mon Jul 12 16:11:43 2010] [warn] NameVirtualHost 192.168.100.250:443 has no VirtualHosts
                                                                                                                                     [ OK ]
    root@ubuntu:/var/www/learn.it# ls
    cgi-bin  log  ssl  tmp  web
    root@ubuntu:/var/www/learn.it# cd web
    root@ubuntu:/var/www/learn.it/web# ls
    error  favicon.ico  index.html  robots.txt  stats
    root@ubuntu:/var/www/learn.it/web#
    
    
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Which output do you get in the browser for the URL:

    http://learn.it/

    as thats the only way that you can access the files of a namebased vhost. Also the web directory does not contain a test.php file, so you can not expect it to be there if you dont upload it into the web directory.
     
  11. rajchd

    rajchd New Member

    Success Message

    http://learn.it show default success message of apache "It works". But in the /var/www/learn.it/web folder, I have some other index.html (default index.html generated by ispconfig3).
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Then the IP of the domain learn.it does not match the IP address that you selcetd in the vhost settings. Ensure that:

    1) The Domain learn.it has a IP address that points to your server.
    2) That you have a DNS A-Record for ww.learn.it that points to the server.
    3) That you created a website for learn.it and that you selcted auto subdomain www in the website settings.
    4) That you selcted the same IP address in the website settings that you used in the dns record. If the IP address does not show up in the list, add it under system > server Ip and then select it in the website settings.

    Be aware that every change that you make needs up to 1-2 minutes until it gets written to disk.
     
  13. rajchd

    rajchd New Member

    Settings

    I was missing A record and auto subdomain, have made these changes

    Code:
    1) The Domain learn.it has a IP address that points to your server.
    
    server name : ubuntu.WORKGROUP
    IP Address : 192.168.100.250
    
    Code:
    2) That you have a DNS A-Record for ww.learn.it that points to the server.
    
    Host Name : ubuntu.WORKGROUP
    IP Address : 192.168.100.250
    
    
    [B]DNS Zone entries[/B]
    
    server: ubuntu.WORKGROUP
    Client: sli
    zone : sli.com. [B](not sure what to put here)[/B]
    NS : 192.168.100.250
    
    
    Code:
    3) That you created a website for learn.it and that you selcted auto subdomain www in the website settings.
    
    was missing subdomain, added now
    
    Code:
    4) That you selcted the same IP address in the website settings that you used in the dns record. If the IP address does not show up in the list, add it under system > server Ip and then select it in the website settings.
    
    I am using same ip address 192.168.100.250 everywhere
    
    I am new to ubuntu and linux, thanks for your help and patience.
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

  15. rajchd

    rajchd New Member

    Thanks

    Thanks for your time and help. I really appreciate it. Guess, I need to study about linux and apache. This is my first linux installation. And yes, I am trying to create a development server in my intranet where I can work on different projects as separate virtual directories. Any advice will be welcome.

    What I intend to do is access this machine as...

    http://192.168.100.250/proj1

    http://192.168.100.250/proj2... and so on
     
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok. This explains why it does not work as accessing websites like this is not possible. The way how to access them is described in the link that I posted above, I use this for all my projects and it works great.
     
  17. rajchd

    rajchd New Member

    reinstall apache

    Alright, I will try to implement it tomorrow in the office. Thankyou very much.
     

Share This Page