Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
indigoe
Jul 29, 2003

gonna steal the show, you know it ain't no crime
I have 2 web servers, one CentOS, the other win2k3, both set up with apache. What I would like to accomplish is that when a file changes in /var/www/html (on the linux machine) it's automatically mirrored to the other server (the windows machine) via FTP. I looked into rsync but I don't think it can do what I need. I also tried to google for other solutions, and found unison, but as I understand it, it will not run automatically.

Is this possible in any way or am I crazy for thinking it up?

Adbot
ADBOT LOVES YOU

indigoe
Jul 29, 2003

gonna steal the show, you know it ain't no crime

teapot posted:

Both rsync and unison will be able to do that (though none of then use FTP -- it's not a good protocol anyway), however they won't start immediately after a file is changed. You can make a simple shell script that checks if timestamp on the directory (or any directory in a subtree) changed since the last time the directory was checked, and only then run rsync or other utility. The script can run in an infinite loop or be called from cron.

None of those solutions are ideal or in fact solve the problem, and as I've noted I already looked at those utilities. Here it is again what I'm trying to accomplish with different words: automatically mirror files to another server via FTP as they change. By the way there is software for windows that can do this, but if it can't be done in linux I guess I can live with that.

indigoe
Jul 29, 2003

gonna steal the show, you know it ain't no crime

GringoGrande posted:

You could check out inotify-tools, which should be able to take care of that. (If your kernel is >=2.6.13)

This would be good but my kernel is 2.6.9. So I will look into a shell script and see how that goes. Thanks for the help although I'm still open to suggestions.

indigoe
Jul 29, 2003

gonna steal the show, you know it ain't no crime
My server suddenly decided to die. When I tried to log in it kept saying access denied, so I rebooted only to be faced with a message informing me that the inittab file was not found. So now I would like to recover some data (web and mysql stuff) before installing ubuntu on it but right now I only have a fedora 7 disk on hand (downloading ubuntu right now). I got into the shell but it won't let me mount /dev/sda2 because /etc/fstab was not found.

Am I screwed?

indigoe
Jul 29, 2003

gonna steal the show, you know it ain't no crime
Mounting /dev/sda2 on /mnt failed: Invalid argument

:confused:

indigoe
Jul 29, 2003

gonna steal the show, you know it ain't no crime

Accipiter posted:

Err... are you using some kind of goofy charset on sda2?

Two things:
1. What pops up in /var/log/messages when you try to mount using the command I gave you?
There is no /var/log/

quote:

2. What does 'fdisk -l /dev/sda' say?

It says it's a 200 GB disk with 2 partitions
/dev/sda1 flagged boot, system linux
/dev/sda2 system linux LVM

I can mount /dev/sda1 and see a bunch of .EL and .img files, grub, lost+found and such.

indigoe
Jul 29, 2003

gonna steal the show, you know it ain't no crime

Accipiter posted:

:psyduck: What the hell kind of bullshit system are you using?


Well that somewhat explains your mounting problem. What does the output of vgscan look like?

I'm booting off a fedora 7 disk with 'linux rescue'. Also there doesn't seem to be a vgscan command.

indigoe
Jul 29, 2003

gonna steal the show, you know it ain't no crime
code:
lvm vgscan
Found volume group "VolGroup00" using metadata type lvm2

indigoe
Jul 29, 2003

gonna steal the show, you know it ain't no crime

Accipiter posted:

Okay so do 'ls -al /dev/VolGroup00/' and paste what that says.

That it cannot access /dev/VolGroup00/ no such file or directory. :(

indigoe
Jul 29, 2003

gonna steal the show, you know it ain't no crime
Yes! That did the trick. Now, I was told that probably the /etc directory got wiped, but as far as I can tell it's still there. So at this point I'm not sure how to proceed.

edit: I found 3 password files. passwd, passwd- and passwd.OLD. The first 2 has 100+ usernames I don't recognise. passwd.OLD has 1 account (mine, in addition to all the system accounts) but accounts missing.

indigoe fucked around with this message at 13:22 on Aug 11, 2007

indigoe
Jul 29, 2003

gonna steal the show, you know it ain't no crime
Yes, I can access the whole contents of the drive. But I would also like to find out what happened and why I have these unknown passwd files, and it would be nice if I could recover inittab somehow. I have 2 disks but the second one is NTFS. I can't mount it from the recovery session to copy the files I want to save. I guess the other option would be to resize the partition and create a second one and save the files there.

indigoe
Jul 29, 2003

gonna steal the show, you know it ain't no crime
Well, the server served 2 purposes, one being my web server for messing around with stuff and second my mp3 storage.

I can see a LOT of failed login attempts spanning a number of days. Someone was still attempting logins as I shut the system off. By the looks of it someone DID get in but surprisingly didn't format the drives just made sure it's going to be difficult to reboot the system.

edit:
Looks like the system has been compromised for much longer than a few days. The security log only goes back 1 month but in that time I found 4 root logins for 3 different IP addresses all in different countries.

I've learnt 2 important lessons so far: make the root password more secure, and move ssh to a different port.

Any ideas how I can get the system to boot up again? Is it worth the effort? I really appreciate the help so far.

indigoe fucked around with this message at 14:59 on Aug 11, 2007

indigoe
Jul 29, 2003

gonna steal the show, you know it ain't no crime
Yeah you are right. I didn't think of disabling remote root login but it sounds like a good idea. Although that wouldn't stop someone from hammering it with attempts. I managed to back up some stuff on a new logical volume and formatted the old one. I just hope I didn't forget to back something up.

I also didn't think to look at security logs and such - as far as I knew everything was working fine. And while I'm interested in learning about this, most of the time I just want the server to be there and work and not have to worry about it.

Thanks again for the help.

indigoe
Jul 29, 2003

gonna steal the show, you know it ain't no crime
I'm attempting to run several virtualised machines using xen. I have them up and running fine, however, I would like all of them to have access to a shared partition, let's call it /dev/LogVol00/data. Now this is mounted by the host, and when I start up a virtual pc I get the message the device is mounted in the privileged domain and so cannot be mounted as guest. Is there any way around this? I know the answer may be as simple as 'not possible' in which case I have a backup plan: map the directory on that partition as a network share on each virtual pc. Or am I crazy for thinking that would be a good idea?

indigoe
Jul 29, 2003

gonna steal the show, you know it ain't no crime

poemdexter posted:

I'm running Kubuntu Fiesty with a fresh install. I basically want to access my Mysql database via SSH from school so that my group can work on it during class and I can do the real work/fix their mistakes at home.

I have both the openSSH server installed and the MySQL server/client installed. I configured my iptables to have 22 open for SSH. So far, I can go through shell to ssh into my own computer with my ip address (ie poemdexter@123.123.123.123 or whatever the ip is at the moment). However, when I am at school, I cannot even ping my own address. The tech support guy at the school says that my ports must not be open because it's not a firewall issue at the school.

Should I call bullshit on him, or am I missing some step to ssh into my computer to be able to get shell access to work on my computer?

Also, I have the official MySQL query browser installed. Could I connect to my database at home through that and skip all of this SSH nonsense?

If you have a router between the server and the internet, the port needs to be forwarded.

Mysql needs to have a user created (I recommend limited privilieges for security reasons) that is able to connect from outside. This is defined by the host field in mysql.user table. % is the mask for all hosts (by default all users must connect from localhost) if you don't know the school's ip address.


RoundsToZero posted:

You generally don't want multiple filesystem drivers hammering the same block device at the same time, which is why it won't let you mount the filesystem twice. The network method should be fine as long performance is good enough. VMware has a "shared folders" feature that doesn't require the network, but in my experience it's actually slower than just using the network.

Thanks, that explains it. I'm not too worried about the load on the server and the purpose of the whole thing is to have various test environments with some shared files. Now I'm trying to get NFS to work but it keeps giving me access denied when I try to mount. I also get these errors in /var/log/messages (on the server) when I attempt to mount the share with the client

code:
nfsd[6923]: nfssvc: writing fds to kernel failed: errno 0 (Success)

indigoe fucked around with this message at 05:14 on Sep 19, 2007

indigoe
Jul 29, 2003

gonna steal the show, you know it ain't no crime
I came up with this one liner to get an idea how many of what processes are running.

ps -aeo cmd | uniq -c | sort -gr | grep -v ' 1 '

It produces the unexpected result where it doesn't quite group everything as it should and I just can't see why.

code:
     73 /usr/local/apache/bin/httpd -DSSL
     42 /usr/local/apache/bin/httpd -DSSL
     28 /usr/local/apache/bin/httpd -DSSL
     21 /usr/local/apache/bin/httpd -DSSL
     15 /usr/local/apache/bin/httpd -DSSL
     11 /usr/local/apache/bin/httpd -DSSL
     10 /usr/local/apache/bin/httpd -DSSL
      9 /usr/local/apache/bin/httpd -DSSL
      7 /usr/local/apache/bin/httpd -DSSL
      6 /usr/libexec/courier-authlib/authdaemond
      6 ./naimas32
      5 /usr/local/apache/bin/httpd -DSSL
      5 [kjournald]
      4 /usr/local/apache/bin/httpd -DSSL
      4 /usr/local/apache/bin/httpd -DSSL
      3 /usr/sbin/exim -bd -q60m
      3 /usr/local/apache/bin/httpd -DSSL
      3 /usr/local/apache/bin/httpd -DSSL
      3 /usr/local/apache/bin/httpd -DSSL
      3 /etc/authlib/authProg
      2 /usr/local/apache/bin/httpd -DSSL
      2 /usr/local/apache/bin/httpd -DSSL
      2 ./naimas32
Any ideas?

Adbot
ADBOT LOVES YOU

indigoe
Jul 29, 2003

gonna steal the show, you know it ain't no crime

covener posted:

sort before uniq, as uniq only discards successive matches. (then sort again to pickup the counts)

Hey thanks :)

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply