Cara Melakukan userdir.conf (User Directory Configuration)
1. sudo a2enmod userdir
Setelah itu kita konfigurasi
Apachenya.
2. sudo nano
/etc/apache2/mods-enabled/userdir.conf
3. Ganti dengan source code ini:
listen 8080
<VirtualHost *:80>
<VirtualHost *:80>
DocumentRoot /var/www/
Alias /admin /home/admin/
AliasMatch /coba /var/www/coba/coba.html
<Directory/>
Options -Indexes FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options -Indexes FollowSymLinks MultiViews
AllowOerride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible value include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog $${APACHE_LOGDIR}/access.log combined
</VirtualHost>
<VirtualHost *8080>
DocumentRoot /var/www2/
Alias /admin /home/admin
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www2>
Options -Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require valid-user
</Directory>
</VirtualHost>
AliasMatch /coba /var/www/coba/coba.html
<Directory/>
Options -Indexes FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options -Indexes FollowSymLinks MultiViews
AllowOerride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible value include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog $${APACHE_LOGDIR}/access.log combined
</VirtualHost>
<VirtualHost *8080>
DocumentRoot /var/www2/
Alias /admin /home/admin
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www2>
Options -Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require valid-user
</Directory>
</VirtualHost>
Seperti pada Gambar dibawah ini :
4. Restart Apache Anda service
apache2 restart mkdir /home/$USER/public_html disini saya mkdir
/home/admin/public_html
5. Kemudian, buat file index.html
nano index.html lalu isi text html
disana:
6. test dengan cara: lynx
localhost:80/public_html
0 komentar:
Posting Komentar