I just fired up a CentOS7 Droplet. Then installed LAMP stack by following these instructions:
I see the “Testing 1,2,3…” page when I visit my server’s IP address, so I assume everything to be working fine. However, when I try to enable mod_rewrite, I see the following error:
[user@server conf]$ sudo a2enmod rewrite [sudo] password for user: sudo: a2enmod: command not found
What am I doing wrong? After much searching I found this Apache help document but it’s just way over the top for me to understand: http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html
Any help offered would be greatly appreciated.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey there,
a2enmod is a Debian/Ubuntu command. You’ll need to edit the Apache config file for a CentOS LAMP server.
What you’d want to do is edit the /etc/httpd/conf/httpd.conf file and make sure that the AllowOverride flag for the <Directory "/var/www/html"> block is changed from None to All.
Basically it should be something like this: (Note: there are many comment lines in the default httpd.conf file)
<Directory "/var/www/html">
Options .....
AllowOverride All
</Directory>
Happy coding,
Jon Schwenn Platform Support Specialist DigitalOcean
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.