. 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.
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.
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.
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.
Explore the best smartphones under ₹20,000 in 2025, featuring top picks for gaming, photography, and all-round performance. Compare specs, pros, and cons to find your perfect budget smartphone.
The Poco X7 Pro and X7 offer 120Hz AMOLED, long-lasting batteries, fast charging, HyperOS, great cameras, and top performance at ₹24,999 and ₹19,999.
Discover the Xiaomi Pad 7’s sleek design, powerful Snapdragon 7+ Gen 3 performance, stunning display, and excellent gaming capabilities. Read our full review for the best tablet experience.
Explore the NVIDIA RTX 5070’s specs, price, and performance, and see how it compares to the RTX 4090 for gaming, content creation, and AI tasks.
Discover the best tablets under ₹30,000 in 2025, including OnePlus Pad Go, Lenovo Tab P12, Redmi Pad Pro 5G, Xiaomi Pad 7, and Samsung Galaxy Tab S9 FE. Compare features, specifications, and performan