Log in

View Full Version : Tutorial on editing config files on a vps/dedi



Hypertext
14-08-2008, 04:35 AM
OK so I posted this to somebody asking for help, and now I'm posting it here, as it might help somebody.

This is for editing a php.ini file, but can be used for pretty much any file.

Various distributions might not contain some preinstalled stuff like vi/vim, so beware if it doesn't work, it might be because of that or you have a strange distro.

This is ALL CLI.

my-awesome-server is your server name, and the $ sign denotes a bash prompt.
your-local-pc is your desktop pc at home.
host-or-ip.com is either an ip like 57.34.75.13 or a domain like example.com
username is your ssh username, i advise you not to login as root for security reasons

your-local-pc $ ssh [email protected]
Please enter the password for [email protected]:
#enter your password and hit enter - in *nix (linux etc), you never see characters like stars for passwords, it's just blank
Thankyou for logging in
### MOTD###

my-awesome-server-name $ cd /etc/
# change directory to /etc/
my-awesome-server-name $ vim php.ini
# vim is an editor, some even use it as an ide, vi is vim's predecessor
# in debian and other os' you can use a "fuzzy search" for instance if you type ph and then <tab>
# it will type as much as it can before it comes to a tree, aka
# it'll come to php.ini and php.d for me, so for me it stops at 'php.'
# and then gives you a windows sounding runtime error, then you'll need to type the next letter and hit enter
my-awesome-server $ <i>
# typing <i> turns vi(m) into insert mode so you can edit, it's all cli so no mouse! :)
#navigate using arrow buttons to an option in your php.ini navigate right and delete the current value
#replace with a new value
my-awesome-server $ <esc>
# hitting escape puts vi(m) into action mode
my-awesome-server $ <:>
# the colon issues a save/exit among other commands i don't know.. im guessing anyway
#the two I know are w and q, w is save, q is quit, wq is save and quit, adding ! is an override.
my-awesome-server $ <wq>
my-awesome-server $ <enter>
# this will save and quit out of your current file
# to restart apache (needed for some changes that are cached.. i think :P)
my-awesome-server $ apachectl graceful
# graceful notes apache to let all file transfers finish before it restarts
# other subcommands such as stop, start, and restart may screw something up as it doesn't let some things finish
# and apache might go wierd about process IDs

Plux
14-08-2008, 10:13 AM
Say someone who has no idea with PHP, has to edit it,
and read this, I bet the first thing they'd say is:

"What the **** is a bash prompt"

Protege
14-08-2008, 11:15 AM
So your saying "all" servers have PHP on - I just loled hard man, failure - again.

Hypertext
14-08-2008, 12:51 PM
A bash prompt is an acronym for a shell prompt, specifically Bourne Again Shell, the original was Bourne Shell, but it was remade, open source.

@Plux: Why the **** do you need to know PHP to know what a bash prompt is?

@Protege:

I never said that, just stop starting a ******* argument and get some friends dude.

Point out where I said that?

Fail.

Plux
14-08-2008, 01:13 PM
A bash prompt is an acronym for a shell prompt, specifically Bourne Again Shell, the original was Bourne Shell, but it was remade, open source.

@Plux: Why the **** do you need to know PHP to know what a bash prompt is?

@Protege:

I never said that, just stop starting a ******* argument and get some friends dude.

Point out where I said that?

Fail.

If someone had no idea whatever it's for then.
Tutorials are meant to explain whats things are etc.

& I'm pretty sure an acronym is something like: BT - British Telecoms

Source
14-08-2008, 01:16 PM
I prefer using nano anyday.

Dentafrice
14-08-2008, 02:21 PM
I prefer using nano anyday.

I was just about to say that.

yum install nano


OK so I posted this to somebody asking for help, and now I'm posting it here, as it might help somebody.

This is for editing a php.ini file, but can be used for pretty much any file.

Various distributions might not contain some preinstalled stuff like vi/vim, so beware if it doesn't work, it might be because of that or you have a strange distro.

This is ALL CLI.

my-awesome-server is your server name, and the $ sign denotes a bash prompt.
your-local-pc is your desktop pc at home.
host-or-ip.com is either an ip like 57.34.75.13 or a domain like example.com
username is your ssh username, i advise you not to login as root for security reasons

your-local-pc $ ssh [email protected]
Please enter the password for [email protected]:
#enter your password and hit enter - in *nix (linux etc), you never see characters like stars for passwords, it's just blank
Thankyou for logging in
### MOTD###

my-awesome-server-name $ cd /etc/
# change directory to /etc/
my-awesome-server-name $ vim php.ini
# vim is an editor, some even use it as an ide, vi is vim's predecessor
# in debian and other os' you can use a "fuzzy search" for instance if you type ph and then <tab>
# it will type as much as it can before it comes to a tree, aka
# it'll come to php.ini and php.d for me, so for me it stops at 'php.'
# and then gives you a windows sounding runtime error, then you'll need to type the next letter and hit enter
my-awesome-server $ <i>
# typing <i> turns vi(m) into insert mode so you can edit, it's all cli so no mouse! :)
#navigate using arrow buttons to an option in your php.ini navigate right and delete the current value
#replace with a new value
my-awesome-server $ <esc>
# hitting escape puts vi(m) into action mode
my-awesome-server $ <:>
# the colon issues a save/exit among other commands i don't know.. im guessing anyway
#the two I know are w and q, w is save, q is quit, wq is save and quit, adding ! is an override.
my-awesome-server $ <wq>
my-awesome-server $ <enter>
# this will save and quit out of your current file
# to restart apache (needed for some changes that are cached.. i think :P)
my-awesome-server $ apachectl graceful
# graceful notes apache to let all file transfers finish before it restarts
# other subcommands such as stop, start, and restart may screw something up as it doesn't let some things finish
# and apache might go wierd about process IDs

Why use vi, or vim? Gross.

Plus just use service httpd restart or service apache restart, you don't need to use apachectl.

Easier just to use PuTTY.

Protege
14-08-2008, 02:24 PM
Tutorial on editing config files on a vps/dedi

Didnt mention PHP in that.

& I dont need HabboxForum friends, cause man - Im a CEO of MainlyBS Entertainment PLC, you should be hired as a joker for this new comedy show.

Hypertext
14-08-2008, 02:29 PM
I prefer Nano, but it's more likely to have Vi(m) installed than Nano :P

A Shell prompt is an ACRONYM for a BASH prompt.

Jeez.

Dentafrice
14-08-2008, 02:35 PM
LOOL!

Shell is not an acronym for anything. Bash is a shell...

SSH - Hence Secure SHELL.

http://en.wikipedia.org/wiki/Bourne-Again_shell

That really made me laugh, you thought Shell was part of bash. hah.

Source
14-08-2008, 03:14 PM
Charlie you do realise all new Debian (from 3. something) distrobutions have Nano pre-installed along with vi and a few others (can't remember what they are called).

A Shell prompt is an ACRONYM for a BASH prompt.

I loled.

Hypertext
14-08-2008, 05:41 PM
I meant the other way round. :rolleyes:

Dentafrice
14-08-2008, 05:42 PM
I meant the other way round. :rolleyes:
LOL, no you didn't. You didn't know. You just wanted to sound smart.

Hypertext
14-08-2008, 05:44 PM
Well if you reverse what I said, it is 100% correct. So stop being a smart *** and stop trying to be a ****. Seriously.. none of that is called for, you knew EXACTLY what I said.

Dentafrice
14-08-2008, 05:44 PM
No, no-one knew exactly what you said, we were too busy laughing at your mistake.

Plux
14-08-2008, 05:45 PM
Well if you reverse what I said, it is 100% correct. So stop being a smart *** and stop trying to be a ****. Seriously.. none of that is called for, you knew EXACTLY what I said.

I didn't understand. I don't have any clue when it comes to PHP. :)

Hypertext
14-08-2008, 05:47 PM
No, no-one knew exactly what you said, we were too busy laughing at your mistake.
You see? Why does every thread on here turn into a ******* flame war. Why don't you stop just making fun of me for absolutely no reason.

Edit: 2000th.

Source
14-08-2008, 05:55 PM
2000th post of trying to be intelligent?

Plux.... non of that is PHP.

Hypertext
14-08-2008, 06:02 PM
2000th post of trying to be intelligent?

Plux.... non of that is PHP.

See right there, that was provocative, flaming, and just making fun of me.

Source
14-08-2008, 06:06 PM
Then just be you rather than this person who is trying to be all great and amazing.

Hypertext
14-08-2008, 06:10 PM
I'm not trying to be great and all amazing.. I was just trying to help a guy out, and decided it might be useful to someone else, instantly everybody yells at me :S

Excellent1
14-08-2008, 06:12 PM
I'm not trying to be great and all amazing.. I was just trying to help a guy out, and decided it might be useful to someone else, instantly everybody yells at me :SBecause you're not smart, stop using words you don't know and google gets things wrong sometimes, you do know that right?

Hypertext
14-08-2008, 06:14 PM
There you go again.

Dentafrice
14-08-2008, 06:15 PM
You see? Why does every thread on here turn into a ******* flame war. Why don't you stop just making fun of me for absolutely no reason.

Edit: 2000th.


See right there, that was provocative, flaming, and just making fun of me.

So? We make fun of you for a reason.. you act like you know things, when you really don't.

You show off too much.

You think you know everything when you don't.

You think you are a "uber 13337z programmer", when you're just a mediocre coder.

Get off of your high horse, and back on your pony.. where you started and belong.

Stepheen
14-08-2008, 06:26 PM
I prefer Nano, but it's more likely to have Vi(m) installed than Nano :P

A Shell prompt is an ACRONYM for a BASH prompt.

Jeez.
LOL your well ugly irl.

Dentafrice
14-08-2008, 06:28 PM
LOL your well ugly irl.
Have you seen the one with bug eyes and his tongue sticking out?

Stepheen
14-08-2008, 06:39 PM
Have you seen the one with bug eyes and his tongue sticking out?
The one I was referring to, and he's just generally erghh.

ebay
15-08-2008, 01:48 AM
Another failure, just like your youtube videos!

You can't compete with the big boys. Dentafrice & Co.

Want to hide these adverts? Register an account for free!