Enable mod_rewrite in ec2 linux and other configuration
Aneh Thakur
. 2 min read
In this post i explain how to enable mod_rewrite in amazon ec2 Linux instance and also show you how to enable gd extension and some use full command which you regular use while working with ec2.
Enable mod_rewrite on ec2 linux
Step 1. Login to server using putty
Step 2. Now switch to super user by typing this command
Step 3. After switching change directory to /etc/httpd/conf
Step 4. Now open this file to edit using command
Step 5. Find <Directory “/var/www/html”> it is on line no 132 in my case and look like as shown bellow, now you need to AllowOverride All from AllowOverride None .
One you edit this save the file using ctrl+o and hit enter and to exit press ctrl + x
Step 6. Now last step is to restart your server type this command
Done! now you can rewrite your url.
Install GD Library in EC2 Linux
Before start please check php info if GD is enable or not, if not then we do :-p.
Step 1. Login to ec2 instance using putty.
Step 2. Type bellow given command
Step 3. Restart server
Done! Now check your phpinfo.
Useful commands you use in putty for ec2
Login as Super User : | sudo su |
---|---|
Open, Save File: | nano <file_name>, ctrl+o, ctrl+x |
Install package using yum: | sudo yum install <Package_name> |
Remove yum package: | sudo yum remove <Package_name> |
Restart Server: | sudo /sbin/service httpd restart or service httpd restart |
Get file from other server: | wget <URL> |
UNZIP file : | unzip <filename.zip> |
Remove file/folder: | rm -rf <file_name> |
Rename file/folder: | mv <file_name> <new_file_name> |
Unistall php, mysql: | sudo yum remove -y httpd24* php56* mysql55-server* php56-mysqlnd* |
All done hope this help you.
happy coding.
More Stories from
DeepSeek R1: The Free Open-Source AI Model That Rivals GPT-4
Discover DeepSeek R1, the free, open-source AI model that rivals GPT-4 in performance. Licensed under MIT, it’s cost-effective, efficient, and transforming the AI landscape. Try it now!
Top 5 Best 5G Phones Under 20000 in India (2025)
Looking for the best 5G phone under 20000 in India? Check out our top picks for 2025, featuring amazing performance, stunning cameras, and excellent battery life. Read now!
Is Blogging Profitable in 2025? Strategies to Thrive in the Digital Era
Discover whether blogging is profitable in 2025 and learn effective strategies to thrive in the digital age with AI tools, niche blogging, and modern monetization methods.
Top 3 Phones Under ₹20,000 in India (2025) – Gaming, Cameras & Design
Discover the best smartphones under ₹20,000 in India (2025). From the gaming powerhouse Poco X6 Pro to the stylish Motorola Edge 50 Neo and the sleek Nothing Phone 2A, find the perfect phone for your needs.
Jio Launches JioCoin on Polygon Network: A Step Towards Blockchain Integration
Jio launches JioCoin on the Polygon network, redefining digital rewards and showcasing blockchain's potential in India's growing tech ecosystem.