Wednesday, May 1, 2024
 Popular · Latest · Hot · Upcoming
26
rated 0 times [  26] [ 0]  / answers: 1 / hits: 97806  / 1 Year ago, fri, march 10, 2023, 3:03:16

As my knowledge about apache is minimal. I'd like to let it grow so I'd have more experience with LAMP. My hot question for today is:



How to add custom directory to webserver? (e.g. phpmyadmin)?



My goal is to be able to create custom addresses with custom websites within. Let's suppose that I have my custom directory at: /media/my/web/portal1 and I'd like to load it when client calls



http://localhost/myportal1 at webbrowser. 


Could you give me a list of steps with few words of explanation?


More From » apache2

 Answers
7

Edit your Apache config file and add an Alias Directive. For example, let's use the default file.



sudo -e /etc/apache2/sites-available/default


Make your alias by adding a section within the VirtualHost directive:



Alias /database/ "/usr/share/php5/phpmyadmin/"
<Directory "/usr/share/php5/phpmyadmin/">
Order allow,deny
Allow from all
# New directive needed in Apache 2.4.3:
Require all granted
</Directory>


Save and restart: sudo /etc/init.d/apache2 restart



Or for the other reference:



sudo -e /etc/apache2/sites-available/default


And the contents...



Alias /myportal1/ "/media/my/web/portal1/"
<Directory "/media/my/web/portal1/">
Order allow,deny
Allow from all
# New directive needed in Apache 2.4.3:
Require all granted
</Directory>


Save and restart: sudo /etc/init.d/apache2 restart



Add more directives within the Directory directives, such as



Options Indexes FollowSymLinks 


See http://httpd.apache.org/docs/2.2/mod/core.html#directory



That what you were after?


[#41187] Saturday, March 11, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ardingiba

Total Points: 497
Total Questions: 95
Total Answers: 109

Location: Gabon
Member since Sat, Jan 15, 2022
2 Years ago
;