Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magento CE 2.4.4 - 404 on static content - developer/default mode #35454

Closed
1 of 5 tasks
aetonsi opened this issue May 11, 2022 · 10 comments
Closed
1 of 5 tasks

Magento CE 2.4.4 - 404 on static content - developer/default mode #35454

aetonsi opened this issue May 11, 2022 · 10 comments
Assignees
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.4 Indicates original Magento version for the Issue report.

Comments

@aetonsi
Copy link

aetonsi commented May 11, 2022

Preconditions (*)

  1. Magento community edition 2.4.4
  2. linux mint 20.3 una (ubuntu) (but SAME result on Windows11 cmd and Windows11 WSL2)
  3. php 8.1.5
  4. composer 2.3.5
  5. mysql ver 8.0.29-ubuntu0.20.04.3 x86_64
  6. elasticsearch 7.17.3
  7. apache/2.4.41 (ubuntu)

Steps to reproduce (*)

  1. install various packages sudo apt install gzip lsof sed tar p7zip-full unzip zip
  2. install and start elastic search with ./bin/elasticsearch -d -p pid
  3. install php 8.1 and its extensions by adding the repository, then sudo apt install php8.1 php8.1-bcmath php8.1-mysql php8.1-ctype php8.1-curl php8.1-dom php8.1-fileinfo php8.1-gd php8.1-iconv php8.1-intl php8.1-mbstring php8.1-simplexml php8.1-soap php8.1-sockets php8.1-tokenizer php8.1-xmlwriter php8.1-xsl php8.1-zip
  4. edit php.ini with these settings, then restart apache2 service:
        date.timezone = Europe/Rome
	memory_limit = -1
	realpath_cache_size = 10M
	realpath_cache_ttl = 7200
	opcache.enable = 1
	opcache.save_comments = 1
  1. install composer via install script
  2. install mysql-server
  3. in DB: create magento user and database in mysql; grant ALL PRIVILEGES to magento user; create database magento
  4. create magento project:
        cd /var/www/html
        composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition magento2
  1. set permissions
        cd /var/www/html/magento2
        find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
        find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
        chown -R :www-data . # Ubuntu
        chmod u+x bin/magento
  1. install magento via
        bin/magento setup:install \
--base-url=http://localhost/magento2 \
--db-host=localhost \
--db-name=magento \
--db-user=magento \
--db-password=magento \
--admin-firstname=ivan \
--admin-lastname=drago \
--admin-email=ivandrago@example.com \
--admin-user=admin \
--admin-password=admin123 \
--language=en_US \
--currency=EUR \
--timezone=Europe/Rome \
--use-rewrites=1 \
--search-engine=elasticsearch7 \
--elasticsearch-host=localhost \
--elasticsearch-port=9200 \
--elasticsearch-index-prefix=magento2 \
--elasticsearch-timeout=15
  1. open http://localhost/magento2/pub

Expected result (*)

i'd expect to see a fully loaded page

Actual result (*)

image

What i tried

sudo a2enmod rewrite
sudo service apache2 restart
cd /var/www/html/magento2
bin/magento deploy:mode:set developer

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented May 11, 2022

Hi @aetonsi. Thank you for your report.
To speed up processing of this issue, make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@aetonsi
Copy link
Author

aetonsi commented May 11, 2022

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @aetonsi. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@engcom-Hotel engcom-Hotel self-assigned this May 11, 2022
@m2-assistant
Copy link

m2-assistant bot commented May 11, 2022

Hi @engcom-Hotel. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Hotel
Copy link
Contributor

Hello @aetonsi,

Thanks for the report and collaboration!

I would like to suggest you create a virtual host and then try to access the instance using the domain name given in the virtual host.

Thanks

@engcom-Hotel engcom-Hotel added the Issue: needs update Additional information is require, waiting for response label May 11, 2022
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board May 11, 2022
@engcom-Hotel engcom-Hotel added the Reported on 2.4.4 Indicates original Magento version for the Issue report. label May 11, 2022
@aetonsi
Copy link
Author

aetonsi commented May 16, 2022

Hello @aetonsi,

Thanks for the report and collaboration!

I would like to suggest you create a virtual host and then try to access the instance using the domain name given in the virtual host.

Thanks

Hello, here it is with virtual host in linux mint, i tried with DocumentRoot /var/www/magento2-domain and DocumentRoot /var/www/magento2-domain/pub, the 404 errors persist...

image

@engcom-Hotel
Copy link
Contributor

Hello @aetonsi,

Thanks for your reply!

I can see the vhost entry but I suggest one change to make as below:

DocumentRoot should change from:
/var/www/magento2-domain
To
/var/www/magento2-domain/pub/

Please make the changes restart the apache and let us know if the issue is fixed or not.

Thanks

@aetonsi
Copy link
Author

aetonsi commented May 17, 2022

No, same result after i restarted apache:

image

@aetonsi
Copy link
Author

aetonsi commented May 17, 2022

Hello,
i got it working in the end.

This is what i did:

  • set file permissions: sudo su
    • chmod 777 . -R ; chown -R :www-data . ; chmod u+x bin/magento
  • edit apache2 config (remove 'indexes' from options, change allowoverride to all): sudo nano /etc/apache2/apache2.conf
     <Directory /var/www/html/>
     	Options FollowSymLinks
     	AllowOverride All
     </Directory>```
    
  • enable apache2 rewrite module: sudo a2enmod rewrite
  • restart apache service: sudo service apache2 restart
  • set file permissions again: sudo chmod 777 . -R
  • sudo php bin/magento setup:upgrade;
  • sudo php bin/magento setup:static-content:deploy -f;
  • sudo php bin/magento cache:clean;

And it is now working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.4 Indicates original Magento version for the Issue report.
Projects
None yet
Development

No branches or pull requests

2 participants