How can I set a document Root?
I'm trying to install openProject on my vps from bluehost. I have a root access to whm and created a cpanel account within WHM.
When installing openProject I can't change the install directory (or at least I'm not sure how). It installs to /opt/openproject
.
The cpanel account domain is example.com (changed to protect the innocent) The cpanel account name is example. I created the db and subdomain in this acccount's cPanel.
I want to load projects.example.com to the root directory opt/openproject
.
In whm I went to Home / Service Configuration / Apache Configuration and chose include edtior.
On this page I went to "post virtualhost include", selected global apache version and pasted this:
<VirtualHost *:80>
ServerName projects.example.com
DocumentRoot /opt/openproject/public
<Directory "/opt/openproject/public">
Require all granted
AllowOverride All
</Directory>
</VirtualHost>
I then restarted apache.
However the url doesn't redirect and when I view the file at /etc/apach2/conf the file has been rebuilt but my entry isn't there.
-
Hey there! Changing Apache like that isn't going to give you the desired result. The best way would be to change this as part of the install of your software, as cPanel isn't going to be able to just have any area be a home directory.
Do you not get that option in the installer? If not, are you not able to move the files to the correct directory after the install completes?
0 -
It looks like WHM might be overriding your custom Apache configuration when it rebuilds the config files. Instead of using the "Post VirtualHost Include," try adding your VirtualHost entry to the Pre Main Include section for your specific Apache version in WHM. Also, ensure that OpenProject is running and accessible on that directory, and check if SELinux or file permissions are blocking access. If it still doesn’t work, you might need to manually create a symlink from
/home/example/public_html/projects
to/opt/openproject/public
or use an.htaccess
redirect. Restart Apache after making changes and check the error logs for any clues (/etc/apache2/logs/error_log
).0
Please sign in to leave a comment.
Comments
2 comments