简体   繁体   中英

how to access localhost ip which has 2 web applications on ubuntu server

I'd like to ask:

I have a server with specifications (ubuntu server 18.04, apache2 webserver, and local ip (example) 192.168.1.1 and in it there are 2 web applications.

How to when access in the browser: 192.168.1.1/web1 --> leads to web application 1 192.168.1.1/web2 --> point to web application 2

thank you

If you want to access your sites via a /directory methodology, you'll need to ensure your Apache configuration points to the bare /var/www directory:

<VirtualHost *:80>
        ServerAdmin none@noaddy.net
        DocumentRoot /var/www

        ServerName localhost
        ServerAlias *.localhost *
        DirectoryIndex index.php index.html

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

        <Directory /var/www>
               Options FollowSymLinks
               AllowOverride All

               Order Allow,Deny
               Allow From All
        </Directory>
</VirtualHost>

Depending on your network and needs, you may also want to look at using local domains so that you can do things like web1.local and web2.local instead of using bae IP addresses.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM