diff --git a/ehcp/ehcpforceupdate.sh b/ehcp/ehcpforceupdate.sh index 7adee11..648fc76 100755 --- a/ehcp/ehcpforceupdate.sh +++ b/ehcp/ehcpforceupdate.sh @@ -3468,6 +3468,26 @@ function createSymlinks(){ if [ ! -e "/var/www/new/phpmyadmin" ] && [ -e "/usr/share/phpmyadmin" ]; then ln -s /usr/share/phpmyadmin "/var/www/new/phpmyadmin" fi + + # Remove some symlinks that can break things depending on certain situations + + # Nginx + # Remove /etc/nginx/sites-enabled/default symlink if exists + if [ -L "/etc/nginx/sites-enabled/default" ]; then + rm -f "/etc/nginx/sites-enabled/default" + if [ -e "/etc/nginx/sites-available/default" ]; then + cp "/etc/nginx/sites-available/default" "/etc/nginx/sites-enabled/default" + fi + fi + + #Apache2 + # Remove /etc/apache2/sites-enabled/default symlink if exists + if [ -L "/etc/apache2/sites-enabled/default" ]; then + rm -f "/etc/apache2/sites-enabled/default" + if [ -e "/etc/apache2/sites-available/default" ]; then + cp "/etc/apache2/sites-available/default" "/etc/apache2/sites-enabled/default" + fi + fi } function preventUserCronFromWebUser(){ diff --git a/ehcp/install_main.sh b/ehcp/install_main.sh index 70cab09..64e6617 100755 --- a/ehcp/install_main.sh +++ b/ehcp/install_main.sh @@ -3131,6 +3131,26 @@ function createSymlinks(){ if [ ! -e "/var/www/new/phpmyadmin" ] && [ -e "/usr/share/phpmyadmin" ]; then ln -s /usr/share/phpmyadmin "/var/www/new/phpmyadmin" fi + + # Remove some symlinks that can break things depending on certain situations + + # Nginx + # Remove /etc/nginx/sites-enabled/default symlink if exists + if [ -L "/etc/nginx/sites-enabled/default" ]; then + rm -f "/etc/nginx/sites-enabled/default" + if [ -e "/etc/nginx/sites-available/default" ]; then + cp "/etc/nginx/sites-available/default" "/etc/nginx/sites-enabled/default" + fi + fi + + #Apache2 + # Remove /etc/apache2/sites-enabled/default symlink if exists + if [ -L "/etc/apache2/sites-enabled/default" ]; then + rm -f "/etc/apache2/sites-enabled/default" + if [ -e "/etc/apache2/sites-available/default" ]; then + cp "/etc/apache2/sites-available/default" "/etc/apache2/sites-enabled/default" + fi + fi } function preventUserCronFromWebUser(){