How to Install in a Virtual Host Sub Directory

Views 620
Sweets 2
Images 1

2 years ago Topic
DaVaR
Administrator
Total Posts: 109
Joined: July 14, 2015
Profile
Posted: May 01, 2016 @ 02:30 PM
I was able to get UAP working in a Sub Directory within a virtual host. First I created the site in its own folder outside of the virtual host location. Location of Main Virtual Host site:
Code
/www/html/main_dir/html_root
Location of Sub Directory
Code
/www/html/sub_dir/uap
Now I setup the Apache2 Virtual Host.
Code
ServerName website.com
DocumentRoot /www/html/main_dir/html_root
Alias /uap "/www/html/sub_dir/uap/public"

<Directory /www/html/main_dir/html_root>
	AllowOverride All
	Options +Indexes
	Require all granted
</Directory>

<Directory /www/html/sub_dir/uap/public>
	AllowOverride All
	Options +Indexes
	Require all granted
</Directory>
Open the /app/Config.php file and edit the following:
Code
define('SITEURL', 'http://website.com/uap/');
define('DIR', '/uap/');
Open the /public/.htaccess file and edit the following:
Code
RewriteBase /uap/
That was all I had to do to get UAP3 working in a sub directory within a virtual host. Hope this helps someone that wants to do something similar.
Signature
MmMmmm... Apple Pie!
Image Attachments
Reply By: tiagolamo
2 years ago #1
tiagolamo
Member
Total Posts: 1
Joined: June 08, 2016
Profile
Posted: June 08, 2016 @ 07:54 PM
DaVaR, I am quite new with HTML and PHP. I tried to search on the web but couldn't find out how my html rootfolder goes from uap/public (where my index.php are) to uap/public/../app. I know this magically happens because all resources loaded from html code consider that it is inside app folder as been the rootfolder, right?
Reply By: DaVaR
2 years ago #2
DaVaR
Administrator
Total Posts: 109
Joined: July 14, 2015
Profile
Posted: June 09, 2016 @ 08:36 PM
I updated the main post since it was missing some code. Small bug that I will have to work out in the forums. lol Anyway. The only way I have been able to get UserApplePie to work on my server under a sub directory is by using the settings above. It does not have to be in a virtual host. You can use the httpd.conf file to run the Alias if needed. Much like PHPMyAdmin does. Just include the following code with updated folder names.
Code
Alias /uap "/www/html/sub_dir/uap/public"

	AllowOverride All
	Options +Indexes
	Require all granted

You may also read into how to use an alias by searching google or using this link.
Signature
MmMmmm... Apple Pie!
Forum Permissions
You cannot post in this forum.
You cannot moderate this forum.
You cannot administrate this forum.
Search Forums
Forum Recent Posts