PDA

View Full Version : Fedor core 5 questions


deicist
9 Jul 2006, 02:20pm
OKay, I recently set up a webserver for a friend using Fedora (because I've never used Linux before, and it seemed simple). The site is at http://84.9.221.97:9991 is anyone fancies visiting :) Anyway, I'm having a problem with Emails. Basically they don't work. I don't have an SMTP server setup, but from what I understand the PHP mail function, or the Linux Sendmail function should just work shouldn't they? Basically I'm lookinf for a way to narrow down where the fault is. I'm starting to suspect that my ISP is blocking outbound SMTP traffic...but I'd like to confirm that before I ring them. So, is there a way to use sendmail to send a simple email from the command line? Or can anyone think of anything else I should try?

The other thing I'm concerned about is security, I currently have the directory the site is served from set to 770, Is that correct?

Oh, and another thing, I want to run the server headless, but the only remote desktop type thing on Fedora is a VNC type thing. This is fine, but you can't connect unless someone is logged in. Is there anyway of letting me log into the desktop remotely from a windows box?

Cheers for any help anyone may be able to offer.

Enverex
9 Jul 2006, 06:12pm
Install SSH for the headless thing.

Sendmail only works if it's sending it to an account on that machine, if it needs to go further out then you need to set up an email server like Exim.

jhenry
9 Jul 2006, 10:20pm
That's funny, according to their website, Sendmail is the most popular SMTP server software. It does the same thing that Postfix or Qmail or Courier or Exim do, they are all SMTP servers.

Is sendmail running? Or, is postfix installed? They might be having a conflict.

Try running:

$ service sendmail start

If you get an error message, jot it down and try this:

$ service postfix start

Same thing as above. Report back with your findings.

deicist
9 Jul 2006, 11:08pm
okay, sendmail is running, postfix is not.

deicist
9 Jul 2006, 11:23pm
right... I just typed 'mail' froma terminal and it gave me loads of information. Apparently all my messages aren't being sent because of 'hostname lookup' failures. Now I know my DNS is working, because I can browse from this machine. Also, I have one '550' error. Is the problem something to do with me not having a domain pointing at this mail server? Does some kind of reverse lookup occur when I send a message?

jhenry
9 Jul 2006, 11:52pm
right... I just typed 'mail' froma terminal and it gave me loads of information. Apparently all my messages aren't being sent because of 'hostname lookup' failures. Now I know my DNS is working, because I can browse from this machine. Also, I have one '550' error. Is the problem something to do with me not having a domain pointing at this mail server? Does some kind of reverse lookup occur when I send a message?

Are your DNS servers set properly in /etc/resolve.conf?

Also, do you have bind installed?

An SMTP 550 error means that the recipient is unknown. (ie, if you sent a mail to nonexistantuser@localhost)

deicist
10 Jul 2006, 11:28am
I have my DNS servers setup through the Fedora network configuration thing, do I need to set them in /etc/resolve.conf as well?

What's bind?

regarding SSH, I thought that was just a remote command line utility, can you run X sessions over it as well (ie: gnome)? How would I go about connecting to a Gnome session from a windows box?

Enverex
10 Jul 2006, 11:48am
Oh, I didn't realise you wanted to run X. To be honest that's a complete waste of resources on the server, it's much better to use SSH and do everything from the command line. If it's a server then you don't need Gnome or even X installed.

BIND is a DNS server, I think jhenry assumed you were using it as it sounded like you were running your own DNS.

Yes, all nameservers need to be set in resolve.conf else they wont work (Fedora should have done that automatically if you were using a network program from it).

deicist
10 Jul 2006, 01:02pm
I'm using a seperate DNS server on a server 2K3 box. It seems to be fine as I can resolve addresses from any machine on my network, including the Linux box (ie: I can ping google.com and it gives me an IP address, and I can browse)

I realise X is a waste of resources but I'm a complete Linux noob and although I can use the command line to do simple things (chown / chmod etc) I'd rather use Gnome. Also the box I'm running all this on is a dual core 3800+ with plenty of RAM.... for a website that's only ever going to have a few users I don't think resources are too much of an issue. So I'm still looking for a way to login into the desktop remotely.

I'll check in resolve.conf when I get it, but I'm assuming that setting name servers in the network config utility in Fedora does that for me anyway...

deicist
10 Jul 2006, 02:15pm
Okay, for the remote desktop thing....I can SSH onto the box and start vncserver with vncserver :1 but then when I connect to this VN session I don't see my desktop, just a blank grey box with a terminal window. So I guess I'm doing something wrong.

This thread ("http://www.linuxquestions.org/questions/showthread.php?t=436602) Says that this approach should work... do I need to do something with the runlevels?


I currently use VNC on FC5 this way. Sometimes when I forget to login before I leave the computer, I can't access it with VNC. But what I can do is login via ssh, change to runlevel 3, startx and a vncserver, then connect via vnc. I constantly get an error over ssh, but the VNC connection

seems to work fine.

It would be really helpful if logging in on the computer wasn't necessary.

Also, when I connect to the computer, I get a pop-up confirming the ip and the display (:1), which I have to manually change to :0 to see my desktop.


when I try to change the runlevel of the server through SSH (init 3) nothing happens.... then when I do 'runlevel' it shows '5 3'. How do I make the server change runlevel?

Linux makes my brain hurt :(

Enverex
10 Jul 2006, 02:18pm
Okay, for the remote desktop thing....I can SSH onto the box and start vncserver with vncserver :1 but then when I connect to this VN session I don't see my desktop, just a blank grey box with a terminal window. So I guess I'm doing something wrong.

Nope, that IS your Desktop, it's just Gnome isn't running, just a terminal window. You can do everything as you'd normally do without the need to load gnome (but if you really want to load gnome I think you can type gnome-session). If you want to VNC into an existing desktop look into "x11vnc".

deicist
10 Jul 2006, 02:41pm
ah, cheers Enverex, x11vnc seems to be exatcly what I'm looking for.

jhenry
10 Jul 2006, 11:11pm
I have my DNS servers setup through the Fedora network configuration thing, do I need to set them in /etc/resolve.conf as well?

What's bind?


Yeah, they'll need to be set there, because that's where the mail server is going to look for the DNS resolvers.

Run

$ yum install bind bind-chroot

See if that will make it work any better

deicist
12 Jul 2006, 11:44am
Okay, I instaleld bind and set my primary DNS to localhost. I also pointed the mx record for my domain at my IP address (something that shouldn't really matter I don't think, since I only want to send mail out, not recieve it)

At some point during my messing around yesterday I obviously did something right, because I recieved all my test emails sometime last night. Unfortunately, because I'm a bit stupid, I don't know at exactly which stage my email started working, and now it's not working again. Joy. Anyway, at least I know now that it's nothing to do with my ISP and it is possible to get it working. Cheers for all the help guys.

deicist
12 Jul 2006, 07:19pm
Right, I think I've narrowed down the problem. When no-one is logged into the console session, or the screen is locked sendmail doesn't work. At all. When someone logs in / unlocks the screen it starts working. Weird.

jhenry
16 Jul 2006, 06:42am
$ chkconfig sendmail on

Then reboot

That'll make sendmail turn on and set the default runlevels (off the top of my head, that should do it)

skryking
17 Jul 2006, 03:34pm
$ chkconfig sendmail on

Then reboot

That'll make sendmail turn on and set the default runlevels (off the top of my head, that should do it)


no need for a reboot, after the chkconfig just start the service with

/etc/init.d/sendmail start


Skryking