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
React Native 0.78 Unveiled: New Features, Changes, and Benefits You’ll Love 🚀
Discover React Native 0.78! From React 19 support to Android vector drawables and better iOS integration, explore the latest features, changes, and benefits with examples to make app development faster and smoother. 🌟
🚀 Encore.ts: Blazing Fast Backend Powerhouse – 9x Faster Than Express.js & 3x Faster Than Bun + Zod
Discover why Encore.ts outshines Express.js and Bun + Zod with 9x and 3x faster performance, respectively. Explore sample code, speed benchmarks, and see how this TypeScript framework redefines backend efficiency! ⚡
Trump Unveils U.S. Crypto Strategic Reserve: Bitcoin and Altcoins Surge
Donald Trump announces a U.S. Crypto Strategic Reserve featuring Bitcoin, Ethereum, XRP, Solana, and Cardano, sparking a $300B market rally. Explore the implications and trends as of March 3, 2025.
Prototype Your Idea in Under an Hour Using AI
Learn to create working prototypes in under an hour using AI tools like Claude and Bolt. Ideal for designers and entrepreneurs with minimal coding skills.
How X’s New Grok AI Tools Make Ad Creation and Analysis a Breeze
Discover X’s latest AI-powered features—Prefill with Grok and Analyze Campaign with Grok. Learn how these tools simplify ad creation, boost campaign performance, and help advertisers save time in 2025.