rodrigo3n
rodrigo3n

Reputation: 123

How to get permission to edit the file apache2.conf? [Ubuntu]

I'm a beginner Ruby on Rails Programmer and I'm trying to install Apache2 + Passenger(That's for Rails Deployment).. and at the end of the installation process, Passenger gave me a few lines to add to the file apache2.conf at /etc/apache2/ but I can't override this file.. I have no permission =( I've also uploaded an image showing me the error.

P.S => I'm logged into Ubuntu with my username and password.

Please help! and thanks, Rodrigo.

Upvotes: 9

Views: 59140

Answers (6)

Newbie
Newbie

Reputation: 72

Or you can use the following chmod 777 usr/local/apache2/conf/httpd.conf this will enable you to read/write the config file but be warned if you are planning on putting apache2 online you must revert it back to the old permissions chmod 640 usr/local/apache2/conf/httpd.conf

Upvotes: 0

Dhivin
Dhivin

Reputation: 706

Enter the command:

sudo nano /etc/apache2.conf

Upvotes: 0

ronniedroid
ronniedroid

Reputation: 1

I hope this will help someone considering the number of years since the last post. I tried this, and it worked for me.

sudo bash

Then the command to edit. Then save the file. Below is the site I got the procedure from.

https://ubuntuforums.org/showthread.php?t=1845306

Upvotes: 0

Stef
Stef

Reputation: 51

After the installation has completed, add phpmyadmin to the apache configuration.

sudo nano /etc/apache2/apache2.conf

Add the phpmyadmin config to the file. Include

/etc/phpmyadmin/apache.conf

Restart apache:

sudo service apache2 restart

Upvotes: 5

Anton Balashov
Anton Balashov

Reputation: 1040

If you are a beginner in GNU/Linux, I want to notice, for run command with root privileges run it with sudo:

sudo <your_command>

If you want to get root privileges for current terminal session (no need to type sudo each command) run:

sudo -i

Upvotes: 0

Josh Lee
Josh Lee

Reputation: 177695

The simplest way is to open the file with the sudoedit program, as in

sudoedit /etc/apache2/apache2.conf

which will prompt for your password and then open your editor.

Upvotes: 16

Related Questions