2

I have installed craftcms 3 on my localhost. It got installed and the following screen appeared: screen which appears

If I click on Control Panel I see the following screen

error 404 not found

4
  • I added minimum steps to make a virtual host and this will surely solve your issue.
    – inrsaurabh
    Sep 30 '19 at 5:34
  • Is your problem solved?
    – inrsaurabh
    Oct 3 '19 at 7:48
  • yes and thanks for the guidance
    – falcon
    Oct 22 '19 at 8:37
  • I am getting same error but i did this code with in 000-default.conf but i get same error, what is file permission 777 of web,config,modules,composer.lock,comsoper.json my virtual host -> mycraftserver.test/admin/login <VirtualHost *:80> ServerName craftcms.local ServerAdmin webmaster@localhost DocumentRoot /var/www/html/craft/web/ ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <Directory /var/www/html> Options Indexes FollowSymLinks MultiViews AllowOverride ALL Require all granted </Directory> </VirtualHost>
    – Sandip Das
    Dec 17 '20 at 7:43
2

As @user suggested, Just create a virtual host by following the below mentioned steps.

Complete Article : Virtual Host

  1. sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/craftcms.local.conf

  2. sudo nano /etc/apache2/sites-available/craftcms.local.conf

  3. Paste the below lines in above file (craftcms.local.conf)

     <VirtualHost *:80>
            ServerName craftcms.local
            ServerAdmin webmaster@localhost
            DocumentRoot /var/www/html/craftcms/web/
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
    
            <Directory /var/www/html>
                     Options Indexes FollowSymLinks MultiViews
                     AllowOverride ALL
                     Require all granted
            </Directory>
    </VirtualHost>
    
    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
    
  4. sudo a2ensite craftcms.local.conf

  5. sudo service apache2 restart

  6. sudo nano /etc/hosts

    add a new hosts at the end of this file like 127.0.0.1 craftcms.local

  7. Open your browser and hit craftcms.local frontend and craftcms.local/admin for admin

7
  • thanks for the guidance, this worked perfectly.
    – falcon
    Oct 22 '19 at 8:36
  • @falcon , you can mark the answer as accepted or even you can share your's as answer.
    – inrsaurabh
    Oct 25 '19 at 6:04
  • @saurabh, I again followed the same steps on Ubuntu 19.10 but this time the control panel url [craftcms.local/admin] shows the same 404 Not Found error. What to do now?
    – falcon
    Oct 29 '19 at 11:03
  • craftcms.local shows the Welcome Page but when you click on control panel [craftcms.local/admin] it shows 404 error not found :(
    – falcon
    Oct 29 '19 at 12:11
  • @falcon check your .env at root of the project and update/add DEFAULT_SITE_URL="craftcms.local"
    – inrsaurabh
    Oct 29 '19 at 13:08
2

You need to set the web server to host from the /web directory. At present it looks like you are serving a folder that contains the Craft folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.