mod_rewrite & Override settings : ERR 404 - NOT FOUND!

Discussion in 'Installation/Configuration' started by Keoz, Jan 2, 2017.

  1. Keoz

    Keoz New Member

    Hello,

    Should someone be able to fix the following script installation issue, it would be helpful and appreciable to be returned a step by step solution ! .........

    /////// REQUIREMENTS BEFORE SCRIPT INSTALL - DONE
    1/ Create domain and sub-domain with default DNS on web hosting provider side (done)
    2/ Make both to point to remote VPS hostname and add IP redirections to corresponding websites (done)
    3/ Enable Apache2 rewrite module (done)
    4/ Create client and both websites on IPS CONFIG3 control panel (Fast-CGI) (done)
    5/ Verify message "It Works" from IPS CONFIG3 on both default "index page" (done)
    6/ Add a database for the sub-domain i.e academie.mysite.com (done)
    7/ Set "RewriteEngine" to "On" within the script ".htaccess" file (default)
    8/ Upload the source code to web root directory : /var/www/clients/client2/web2/web (done)

    /////// .HTACCESS FILE SETTINGS
    View details : http://pastebin.com/raw/3TDiu98D

    /////// START SCRIPT INSTALLATION FAILS : ERROR 404 - NOT FOUND!
    *** I have been testing OVERRIDE SETTINGS configuration in different files ***
    Settings were based on this thread : https://www.howtoforge.com/community/threads/ispconfig3-and-rewrite.39629/
    Results
    • URL entry : academie.mysite.com, or www.academie.mysite.com
    • Message (ISO Config rich text) : ERROR 404 - NOT FOUND !
    Other failures ???
    • Entry : sudo a2ensite academie.mysite.com.vhost
    • Output : ERROR: Site academie.mysite.com.vhost does not exist!

    /////// QUESTIONS - SERVER OVERRIDE SETTINGS
    Within what file to modify settings ?

    • /var/www/clients/client2/web2/web (create file) ?
    • /etc/apache2/sites-available/000-default.conf ?
    • /etc/apache2/sites-available/academie.mysite.com.vhost ?
    • Should I recopy/replace the above ".vhost" file and change extension to ".conf" ?
    • etc.
    What content to modify or add ?
    - 1
    ...................
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    - 2 ...................
    AllowOverride All
    - 3 ...................
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all

    Awaiting for help and guidance asap please !
     
  2. cbj4074

    cbj4074 Member

    What script are you attempting to install, specifically?

    Regarding mod_rewrite, did you reload Apache after enabling mod_rewrite?

    As for your "Other Failures" questions: no, don't do that. When using ISPConfig to manage a virtual host, you should never be using "a2ensite" and the like. ISPConfig will enable and disable sites based on selections made in the ISPConfig graphical interface.

    With regard to "Within what file to modify settings", again, no; do not modify any of those files manually. ISPConfig will overwrite any such "manual changes". You should (almost) always use the graphical interface!

    Finally, as for "What content to modify or add", it really depends on what you are trying to install...
     
  3. Keoz

    Keoz New Member

    Thanks !
    And HAPPY NEW YEAR 2017 to all the forum members 8

    The script is named SCHOEX (web source) :
    https://codecanyon.net/item/schoex-ultimate-school-management-system/9797830

    As further to your guidance, I did not change default settings within the files in the
    "sites-available" directory. But command line to reload or restart Apache2 fails on step 3 below.

    So could someone then reply to precise questions on step 4 below ?
    - Aspache2 upgrade (v2.2 to 2.4.x) and files extension
    - Symlinks

    /////// STEP 1 (done)
    Changing all websites files default ".vhost" extension to ".conf" in the "sites-available" directory. View apache2 upgrade web doc.

    /////// STEP 2 (done : but disadvised OK on step 4)
    Command line : a2ensite mysite.com.conf
    Command line : a2ensite subdomain.mysite.com.conf

    /////// STEP 3 (error)
    Command :
    # sudo service apache2 reload
    Output : apache2.service is not active, cannot reload.
    ................................
    Command : # sudo service apache2 restart
    Output : apache2.service is not active, cannot restart.
    ................................
    Command : # sudo /var/log/ispconfig/httpd/mysite.com/error.log
    Output : -bash: /var/log/ispconfig/httpd/mysite.com/error.log: Permission denied

    /////// STEP 4 (questions)
    I have reinstalled the server
    and will not enter command line "a2ensite" again, but I still have
    pre-installation questions regarding the script SCHOEX :

    - 4.1 -
    Since Should it be inevitable to change default and new websites files extension from ".vhost" to ".conf" to have some corresponding scripts installation running properly ?

    - 4.2 -
    As the "sites-available" directory contains both the "ispconfig.vhost" and the "ispconfig.conf" file, should I (or should I not) remove the ".vhost" file ?

    - 4.3 -
    How can I enable new websites (or controle that they are enabled) from ISP Config3 panel ?

    - 4.4 -
    Should I additionally create symlinks to redirect webistes files from "sites-available" directory to their alias files within the "sites-enabled" directory (or inversely) ?

    Regards,

    KS
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The reason for your problem is that you renamed files from .vhost .conf which you may not do on an ispconfig server as these files are always named.vhost in ispconfig and that you used the a2enconf command manually which created duplicate symlinks. If you rename files, your apache will crash and stop working and if you use a2encof, you will get duplicate symlinks and apache stops working as well. So to fix your issues, undo all changes that you made manually in regard to the apache config files.

    Reagrding the other 4.x proposals, any of these will damage your configuration and none of them is nescessary. See your post in the general Linux forum, I told you there how to upgrade a system from apache 2.2 to 2.4 properyl and the whole process does not need any config file editing.
     
  5. Keoz

    Keoz New Member

    I did not had to upgrade apache2, as apache version 2.4.x was default vesrion in LAMP that was included when I installed ISP Config3 (howtoforge doc).
    Fortunately and Thanks to you, I understand now that some updates (files extension) due to Apache upgrade are not needed when using ISP Config3 panel....

    /////// QUESTION
    However, I have been told by another member on this forum that settings could be changed or added within the "ispconfig.vhost" (i.e AllowOverride All) as a possible requirement to start the script installation properly. This means without having the installation URL pointing to ERROR 404 - NOT FOUND!

    Do you agree this, or should it be sufficient to simply reload apache2 to perform the script installation ?

    Regards

    KS
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, so why do you want to change any cnfigs then? all your config is already correct for apache 2.4 then.

    AllowOverrideAll is the default of every ISPConfig vhost, so you do not have to change any filesand you do not have to reload apache. You can easily see that yourself, go to the /etc/apache2/sites-available/ folder, there you can find the vhost file of each website that you created in ispconfig, open the file of the website were you want to install your software, inside you can see a line:

    <Directory /var/www/yourdomain.tld/web>

    and a few lines below you see:

    AllowOverride All

    So as you can see, you are allowed to override all settings from within a .htaccess file in that website by default.
     
  7. Keoz

    Keoz New Member

    Because I could not find out why the script installation URL can't stop pointing the same error page : ERROR 404 - NOT FOUND!

    Please consider both the following and script documentation links :
    - URL type to run the script installation : http://subdomain.mysite.com/path_to_script/install
    - This is the installation section of the script documentation

    Applying all your guidance, I am now giving a new try to install the script the same way as I did it at the very first time ! I will let you know if I am still facing the same error page.

    Regards,

    KS
     
  8. Keoz

    Keoz New Member

    The issue is almost solved ; I post a new thread to understand why the error page is now a blank page with this simple plain text message : Error in exception handler.

    Thanks for your kind help until now !

    KS
     

Share This Page