Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am a complete newbie at this and my questions could sound very stupid but anyway:
I have to change the data in this pg_hba.conf file in order to be able to remotely edit my postgre/php system. Unfortunately I am not familiar to any extend with *nix OS or DOS commands. This is a complete darkness to me.
I somehow found that if I type:
locate pg_hba.conf
...and press enter, it gives me several possible locations of the file I searched for.
What do you mean by "what is the meaning of..."? locate tells you the locations of filenames matching what you've entered. Here, it tells you that there are files located in /usr/local/pgsql/data and /usr/local/pgsql/data1 named pg_hba.conf. You can enter those directories using cd, e.g. "cd /usr/local/pgsql/data1".
You can use any text editor to edit the files, it's up to you. You just need to follow the executable with the filename, e.g. "vi pg_hba.conf", "emacs pg_hba.conf", etc. You may find nano/pico easy to use and also you may need to become root to edit the files (which you can do with su).
One way to edit the file (there several different ways)
Quote:
gedit pg_hba.conf &
Or, to combine the two together do this:
Quote:
gedit /usr/local/pgsql/data/pg_hba.conf &
gedit opens a window with the file in it, availble for editing
The first argument is the file name.
The & runs the command in the background, as opposed to running it exclusively. One should always use the ampersand when running anything that is going to open it's own window.
I am not sure of the specifics of PostgreSQL, but there is one other thing to be aware of:
Linux has files which are links, they are conceptually the same thing as a shortcut in windows. Be careful that some of the files found in your locate command could be links to 1 file - so you might only have to edit 1 file. When you look at the files user a file browser it should tell you whether it's link or not.
How to open Nautilus:
Quote:
nautilus &
or open it from the main menu.
It's not a bad idea to fill in which distribution of Linux you are using, in your LQ profile. This info is rather helpful to those trying to help.
Nylex is faster at typing than me
anyway have a great time with Linux
Actually there is one more problem, obviously I have to restart the system for the changes to take effect, but I'm not sure how to do it remotely. I use Putty to connect to the server, and I do not know which server to restart, the Apache, the Postgre, or the Linux?
If you only change the postgres configuration postgres is obviously
all you'll need to restart. If it's a slack-box there may (or may
not) be a special startup-script that you can use to do that, depending
on who and how they installed postgres.
If you have root-access something like (paths adjusted, of course)
should work ...
Code:
su - postgres -c "/usr/local/pgsql/bin/pg_ctl stop -l /usr/local/pgsql/data/logfile -D /usr/local/pgsql/data
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.