0

I'm on U13.10 and have installed LAMP per the Tux Tweaks instructions (see their website -- apparently I'm not yet allowed to post the actual link). Then I followed Tux Tweaks instructions on configuring Apache for custom home directory access: (Again, not allowed to post link, but see "How to Configure Apache Web Server on Linux".) All of this is just fine and I've got various directories in my home folder able to be accessed simply by going to, e.g.,

http://mywebdevdir/

which is pointing to /home/me/mywebdevdir/

My issue is I've got a home network running open ssh server, and that computer's apache cannot do this trick. If the ssh server is on 192.168.0.x then http://192.168.0.x/mywebdevdir/ cannot be accessed/seen -- although http://192.168.0.x/ goes to the default /var/www/... just fine. Any ideas how I can extend the configuration to home directory access across home network?

1
  • Configure Apache as a reverse proxy? Mar 24, 2014 at 16:14

1 Answer 1

0

Im not 100% sure what you are asking but if im reading the question right. Do you want to directly access your Website from anywhere in your Home Network by using the machines IP address?.

If this is case. follow the procedure below, edit 000-default.conf add your website folder name after DocumentRoot /var/www/. Save and exit the file. Restart Apache server and type IP address in a browser on any home system in your network. Your index page will loaded. If you requite Remote access then you need to add the IP Address of your web server in the section Virtual Servers on your home Router and make sure the Port is set to 80.

$ cd /etc/apache2/sites-enabled/

$ ls
000-default.conf

$ cat 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/mywebsite

    # 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
</VirtualHost>
3
  • In the Tux Tweaks article I mentioned, you make a new .conf file specific to the new "virtual host" you want to have, e.g., you copy 000-default.conf to mywebdevfolder.conf and you change the contents appropriately. Then follow the rest of the instructions. This works perfectly for on-the-same-machine use. Now I want to access mywebdevfolder across my home network, i.e., 192.168.0.x/mywebdevfolder/ . Do I change something on the server machine such as /etc/hosts? What is meant by "...you need to add the IP Address of your web server in the section Virtual Servers on your home Router..."?
    – user97954
    Mar 24, 2014 at 19:20
  • I added that if you want access from outside the home network using your WAN IP. Don't worry about that. That was an addition. If you have a (((single Website))) follow the guide, then type the IP address on any System on the same Home Network. The IP address of your Web Server thats running Apache. OR do you have multiple websites?.
    – Tasos
    Mar 24, 2014 at 19:28
  • As I'm saying, computers on my home network can reach the apache web server computer just fine -- but only for the default install locations, i.e., /var/www/... So "http:/192.168.0.x" works to the server's /var/www/... location, but not the newly added /home/me/newfolder. On the server "http:/newfolder/" work just fine too. I just want "http:/192.168.0.x/newfolder/ to work. The whole idea was to get away from /var/www/ with its root permissions, then to access these /home/me/... "sites" across my home network.
    – user97954
    Mar 24, 2014 at 21:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .