On my Raspberry Pi 3+ I followed the instructions to install and configure apache, and now I can view:
- Default apache configuration on
localhost
, and - GCI webpage on
gci.example.com
Configuration Files
gci.conf
pi@raspberrypi:~ $ cat /etc/apache2/sites-available/gci.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 gci.example.com
ServerAdmin [email protected]
ServerAlias www.gci.example.com
DocumentRoot /var/www/gci/public_html/
<Directory /var/www/gci/public_html/>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
# 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>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
hosts
pi@raspberrypi:~ $ cat /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.1.1 raspberrypi
127.0.0.1 www.gci.example.com
Access both localhost
and gci.example.com
I have connected to my Pi using SSH using PuTTY, and I have added the tunneling as below:
Now, when I go to localhost
I can see the default apache page which is configured, but I am not able to find the gci
webpage.
I've tried to use a different port, but it was not working. I am new to apache, so might have done something wrong?
I want to access multiple websites configured under /var/www/
of my Pi from my Windows machine using PuTTY, or other tools (if required).
These links link-1, link-2 suggested using DNS settings, but I don't understand how to do that.
ifconfig
pi@raspberrypi:~ $ ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether b8:27:eb:40:c3:ea txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 33 bytes 15256 (14.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 33 bytes 15256 (14.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.102 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::1de9:48e4:f9ed:2850 prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:15:96:bf txqueuelen 1000 (Ethernet)
RX packets 1124 bytes 243059 (237.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 755 bytes 128636 (125.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
/var/www/
or do you want to tunnel the HTTP requests from web-browser on one machine to a web-server on another machine via SSH?