I just made a website through Apache server and word-press. I am able to access it when i am connected to local network.Although i have done port forwarding settings to my router and through ufw i can't access it from other networks. I am using 'public_ip'/site1 (when i am from local 192.168.x.x) but i get 403 forbidden. If i don't use /site1 i got the page that says Apache works, and i suppose that means my port-forwarding works well. So i believe it has to do with word-press settings or /var/www/html/site1 permissions. Here is ls -l /var/www/html/site1 output: everything is -rwxr-xr-x except wp-admin,wp-content,wp-includes which is drwxr-xr-x thanks in advance guys edit: virtual host conf file is the apache default(000-default.conf)

<VirtualHost *:80>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    #ServerName www.example.com

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf
  • Please post the content of your virtual host configuration file. – pa4080 Sep 14 '18 at 2:10
  • i edit it, it is the defualt apache conf – Nikos Tzagarakis Sep 14 '18 at 10:48
  • Please review section 3.B. Setup Apache2: Append WordPress to an existing Virtual Host in this answer: askubuntu.com/a/941947/566421. In addition for your case you do not need of the Alias directive, and maybe you should add ServerName <your-LAN-ip> and ServerAlias <your-public-ip> or vice versa. I would prefer to buy a cheap domain name, for example the price of .me, .ninja, .space, .site is about $4/year - you can buy it from www.domain.com or any other DNS provider. – pa4080 Sep 14 '18 at 11:18

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.