Some things I'd like my server to do - And can't figure out
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Some things I'd like my server to do - And can't figure out
What I want to do is, starting with the most simple:
1. Make it automatically run 'vncserver' in a terminal so I don't have to do that blindly (or switching monitor over) to start it.
2. Make it automatically log on when starting up.
3. Scheduled (automatic) restarts at the time most suitable, i.e, when no one accesses the website.
9293282. Make it turn itself back on if it shuts down (yea right...)
Other things is, I'm running a site with apache2, php5, mysql5, and anything that requires email validation says it sent, but no one ever recieves the e-mail - how do I set this up to work properly? I'd rather not let people sign up with bogus e-mail addresses.
Also, last night I woke up to find my server off Is there ANY log that could tell me why, what happened, or when it turned off?
I don't have the experience to use Debian or anything else than FC6 really.
3. Do you want the whole machine to shut down, or just certain services? If the machine, why? Linux is pretty stable. I suppose if you pay a lot for power, but...either way, you want a cron (or anacron or whatever) job. Definitely do a 'man cron' and 'man crontab' at a minimum if you aren't familiar with cron. Here are two pages that should help you get started:
for log messages, check /var/log/messages. That may give you some idea as to why your machine shut down.
Can't help with the email-sorry about that. Setting up email can be a tricky thing-the servers tend to be easy to set up with security holes, so I won't even go there.
You sound like you are new to the Linux world. Welcome! You should note that I found the above links using Google in less than 5 minutes, although I did know what I was looking for. I know sometimes you just don't know what to search for, but I suggest you try web searches first because many folks will simply ignore forum posts that can basically be answered by Google searches, which will greatly annoy you.
1) Yes there are two ways of running VNC server automatically. Once it logs in as a user, of course you can have it execute as a startup in the user's .bashrc or .profile or something like that (these files are hidden in user's home directory). The system startup scrips alone won't work because vnc requires to be run from a valid logged in user and the system startup scripts run before the user logs in. The second way of running vncserver is to run it "as a service" where once connecting you get a login prompt much like the MS Windows Terminal-server/Remote-desktop system. I've never set it up this way but I think the instructions are on the realvnc website over in the UK. Look for "running vnc from inet.d" or just google it.
2) Yea, this is normally discouraged, but I guess if you have the server locked away in a secure location, it's not so bad. It is just that a lot of people run Linux servers and never seem to see a need for such action. Maybe you trying to do something in an awkward way?
3) This is an even stranger request. Why do you need this? About the only time I need to reboot a Linux server is when I change update a kernel and now with kexec I guess you don't even need to do it then! I suppose if you are running one of those bad-news binary-only kernel modules that has a memory leak or something, you might have to do something like this, but people generally avoid using such hardware like high end 3D video cards or flaky-supported network hardware in Linux servers for this reason.
4) This is a feature of many BIOS of modern computers. You might see if the BIOS in your computer has the ability to auto-restart after an improper system shutdown.
2) Why do you need an automatic login on a headless (no monitor) system?
3) I suppose that you can run a shutdown -r command from cron
4) Newer BIOSes have the option to restore to the previous power state after a power failure; so if the machine was off, it will stay off after a power failure but if it was on, it will turn itelf on after a power failure
regarding Q1 about vncserver, i'm not really sure what you want to do, but it seems you want a vncserver to start up on reboot. ? have a look at /etc/rc.d/init.d/vncserver which uses /etc/sysconfig/vncservers as a config file.
in /etc/sysconfig/vncservers you can set up an string of users/ports to start up, as well as an array of configuration options for each of them. for example, if you want user user1 to start a vncserver on port 10 and user2 on port 20, with display options of "-geometry 1176x950 -depth 24" you would have the following:
I would use xinetd to setup vnc on demand, and set it to login using XDMCP.
This is from Linux Server Hacks, but gives you the general idea:
Create the file /etc/xinetd.d/vnc containing:
# default: on
# description: vncserver provides remote desktop connections
disable = no
socket_type = stream
protocol = tcp
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = :8 -inetd -once -query localhost -depth 24 -geometry 1024x768 -securitytypes=none
The server_args line should be one contiguous line. Then in Gnome or KDE enable XDMCP. Then when you try to connect using vncviewer you'll get a graphical login greeter. That's the gist of it, your mileage may vary.
As for automatic reboots and automatic logging in, I don't see any reason why you would want to do either.