Apache EHCP Template Changes and Symlink Fixes

This commit is contained in:
earnolmartin 2020-05-06 12:33:33 -06:00
parent db1bcf9df5
commit fa627f61b9
6 changed files with 100 additions and 2 deletions

View file

@ -32,5 +32,21 @@
Deny from all Deny from all
</Files> </Files>
<Location "/extplorer">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/var/www:/usr/share/php:/usr/share/pear; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/var/lib/roundcube:/etc/roundcube:/usr/share:/tmp:/var/www/php_sessions:/var/log/roundcube; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail2">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}/webmail2; \n upload_tmp_dir={ehcpdir}/webmail2/data; \n session.save_path={ehcpdir}/webmail2/data;"
</Location>
<Location "/phpmyadmin">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
</VirtualHost> </VirtualHost>
# END OF CUSTOM GLOBAL PANEL URLS Template # END OF CUSTOM GLOBAL PANEL URLS Template

View file

@ -3223,6 +3223,20 @@ function installPipManuallyIfNeeded(){
cd "$curDir" cd "$curDir"
} }
function createSymlinks(){
if [ ! -e "/var/www/new/ehcp/webmail" ] && [ -e "/usr/share/roundcube" ]; then
ln -s /usr/share/roundcube /var/www/new/ehcp/webmail
fi
if [ ! -e "/var/www/new/ehcp/phpmyadmin" ] && [ -e "/usr/share/phpmyadmin" ]; then
ln -s /usr/share/phpmyadmin /var/www/new/ehcp/phpmyadmin
fi
if [ ! -e "/var/www/new/phpmyadmin" ] && [ -e "/usr/share/phpmyadmin" ]; then
ln -s /usr/share/phpmyadmin "/var/www/new/phpmyadmin"
fi
}
############################### ###############################
###START OF SCRIPT MAIN CODE### ###START OF SCRIPT MAIN CODE###
############################### ###############################
@ -3454,6 +3468,9 @@ syncDomainsEHCP
echo -e "Enabling postfix submission port (587)...\n" echo -e "Enabling postfix submission port (587)...\n"
postfixEnableSubmissionPortByDefault postfixEnableSubmissionPortByDefault
# Create symlinks
createSymlinks
echo -e "Restarting web services, synchronizing domains, and finalizing installation!\n" echo -e "Restarting web services, synchronizing domains, and finalizing installation!\n"
# Start the services and sync domains # Start the services and sync domains
finalize finalize

View file

@ -30,7 +30,23 @@
</Files> </Files>
ProxyPassMatch ^(.*\.php)$ fcgi://127.0.0.1:9001{ehcpdir}/$1 ProxyPassMatch ^(.*\.php)$ fcgi://127.0.0.1:9001{ehcpdir}/$1
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/usr/share/php:/usr/share/pear" ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/usr/share/php:/usr/share/pear; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
<Location "/extplorer">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/var/www:/usr/share/php:/usr/share/pear; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/var/lib/roundcube:/etc/roundcube:/usr/share:/tmp:/var/www/php_sessions:/var/log/roundcube; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail2">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}/webmail2; \n upload_tmp_dir={ehcpdir}/webmail2/data; \n session.save_path={ehcpdir}/webmail2/data;"
</Location>
<Location "/phpmyadmin">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
</VirtualHost> </VirtualHost>
# END OF CUSTOM GLOBAL PANEL URLS Template # END OF CUSTOM GLOBAL PANEL URLS Template

View file

@ -40,6 +40,22 @@
Deny from all Deny from all
</Files> </Files>
<Location "/extplorer">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/var/www:/usr/share/php:/usr/share/pear; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/var/lib/roundcube:/etc/roundcube:/usr/share:/tmp:/var/www/php_sessions:/var/log/roundcube; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail2">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}/webmail2; \n upload_tmp_dir={ehcpdir}/webmail2/data; \n session.save_path={ehcpdir}/webmail2/data;"
</Location>
<Location "/phpmyadmin">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
SSLEngine on SSLEngine on
SSLCertificateFile {ssl_cert_path} SSLCertificateFile {ssl_cert_path}
SSLCertificateKeyFile {ssl_cert_key_path} SSLCertificateKeyFile {ssl_cert_key_path}

View file

@ -32,6 +32,22 @@
Deny from all Deny from all
</Files> </Files>
<Location "/extplorer">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/var/www:/usr/share/php:/usr/share/pear; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/var/lib/roundcube:/etc/roundcube:/usr/share:/tmp:/var/www/php_sessions:/var/log/roundcube; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail2">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}/webmail2; \n upload_tmp_dir={ehcpdir}/webmail2/data; \n session.save_path={ehcpdir}/webmail2/data;"
</Location>
<Location "/phpmyadmin">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
SSLEngine on SSLEngine on
SSLCertificateFile {ssl_cert_path} SSLCertificateFile {ssl_cert_path}
SSLCertificateKeyFile {ssl_cert_key_path} SSLCertificateKeyFile {ssl_cert_key_path}

View file

@ -2930,6 +2930,20 @@ function installPipManuallyIfNeeded(){
cd "$curDir" cd "$curDir"
} }
function createSymlinks(){
if [ ! -e "/var/www/new/ehcp/webmail" ] && [ -e "/usr/share/roundcube" ]; then
ln -s /usr/share/roundcube /var/www/new/ehcp/webmail
fi
if [ ! -e "/var/www/new/ehcp/phpmyadmin" ] && [ -e "/usr/share/phpmyadmin" ]; then
ln -s /usr/share/phpmyadmin /var/www/new/ehcp/phpmyadmin
fi
if [ ! -e "/var/www/new/phpmyadmin" ] && [ -e "/usr/share/phpmyadmin" ]; then
ln -s /usr/share/phpmyadmin "/var/www/new/phpmyadmin"
fi
}
############################################################# #############################################################
# End Functions & Start Install # # End Functions & Start Install #
############################################################# #############################################################
@ -3119,6 +3133,9 @@ syncDomainsEHCP
# Enable postfix submission port by default # Enable postfix submission port by default
postfixEnableSubmissionPortByDefault postfixEnableSubmissionPortByDefault
# Create symlinks
createSymlinks
# Restart neccessary daemons # Restart neccessary daemons
echo "Initializing the EHCP Daemon" echo "Initializing the EHCP Daemon"
restartDaemons restartDaemons