General :: Bash Script To Automate The Virtual Host Creation Process?

Mar 14, 2011

This is my sample code in /etc/httpd/conf.d/applications.conf file currently we are creating subdomain mannually for every new subdomain. I want to automate this process througs bash script , how its possible.

Code:

<VirtualHost *:80>
ServerName google.com
ServerAlias google.com

[code]....

In this code which i marked BOLD that content only we'l change for every subdomain. while manually doing this most of the times errors are coming to avoid that i need to automate this process.

View 3 Replies


ADVERTISEMENT

General :: Automate A Definition Process?

May 24, 2011

I would like to automate a definition process. I have 11,581 to define. :|

I would like to read each word, copy the definition(s) and append it next or below the word or save definitions to file.

The word list has one word per line.

Python script?
Bash?
Perl?

Its an interesting project but I cant seem to figure it out. Lack of programming skills.

View 2 Replies View Related

General :: How To Automate Log Deletion Process

Feb 25, 2010

I have RHEL Machine in production server where we gets usual alerts that logs filling up spaces. We archive those logs but in case it grows maximum we delete the old ones. Any idea how can we autiomate the process.

View 1 Replies View Related

Server :: How To Automate Starting A Process In Gnu Screen And Restart It When It Crashes

Sep 10, 2010

I have a java service that needs to be run in a gnu screen session so that I can -r into it to access it's interactive shell. I would like this to run at start-up. More importantly, it crashes frequently so I need the service to restart itself when it crashes. How do I go about doing this myself? My previous experience with shell scripting amounts to putting ./service in a file and marking it executable. This will be running on a FreeBSD server, but I might put it on a Linux server soon also. So any caveats on the differences would be useful information.

View 6 Replies View Related

OpenSUSE :: Backup Important Files - Automate The Process Using Rsync And Cron

Aug 14, 2011

I would like to backup important files (totaling about 400GB) on my ext 4 RAID 5 array to an ext4 external hard drive over USB (external drive is mounted to /mnt. In the future I'd like to automate the process using rsync and cron so for now I'm using rsync to transfer the files. My problem is that using the rsync command like this: # rsync -Pr "/dir1" "/dir2" "/dir3" "/dir4" /mnt

rsync shows me the checks and transfers for awhile and then throws up an i/o error (wish I had a screenshot to show but I don't). When I ls /mnt I get a similar i/o error. I then check /dev for the drive and find that it no longer shows up. Originally the partition was /dev/sdc1. I tried unplugging the USB at this point, plugging it back in and mounting the drive back to /mnt, however it has now assigned it to (you guessed it) /dev/sdd1. I get the drive mounted and try the original rsync command again, hoping the first error was a fluke or some kind of one-time drive fart. This time it makes it quite a bit further and then throws up the exact same problem. Am I doing something terribly wrong here? As I said, I'm very new to bash so I'm not making some absolutely moronic, newbie mistake.

View 9 Replies View Related

Software :: Shell Script Commands To Automate Server Or Host Telnet Login Session?

Feb 7, 2010

finally i found the script for telnet automated login session...<<Mod edit: questionable link removed>>

View 4 Replies View Related

Server :: Apache2 Virtual Host Defaulting To Default Host

Oct 30, 2009

Bit of an odd one, this. I've migrated a website from my old server to a new machine. Both servers run Ubuntu + Apache2. Both only serve a single site, apart from the default site.I've flipped the domain name to the new IP address.The trouble is that after moving the virtual host config over into sites-available, with the necessary link in sites-enabled, Apache attempts to serve from the default web root (/var/www) rather than the actual site content (in /var/www/technology). So for example, an attempt to browse.

View 1 Replies View Related

Programming :: Get The Creation Time Of A Process Via Pid In C++

Mar 22, 2010

Scenario: ( in C++ code)

I need a process A to be able to get the start time of process B. I have the PID of the process B.

I would have thought there would be a simple system call to make by passing in the pid of Process B, but I don't thing there is??!!

So my other thought is to create a script that will be passed the pid and either I can read the file creation of /proc/<PID>/stat or I could also parse the start time of ps on the <PID>. This script can be ran from the C++ code. My difficulty is capturing this information in the C++ code. If I run exec ( or system if not a script) I need the results in a program variable....not stdout.

My only solution is write it to a tmp file and read it back into the program variable. Seems rather arguious but a least it would work.

Background - I need to port Windows code ( GetProcessTimes(creationtime,...))

View 4 Replies View Related

Ubuntu Servers :: Write A Shell Script In Order To Automate The Process Of Uploading A File?

May 21, 2010

I am trying to write a shell script in order to automate the process of uploading a file onto an FTP server using the built in FTP commands in ubuntu server (lucid). In order to connect I can use the following:

Code:

ftp wsbeorchids.org.uk
Name (wsbeorchids.org.uk:danielgroves): USERNAME
Password: PASSWORD

In need to pass my username and password in when prompted the prompts. How should I go about doing this? I have tried echoing the values without success. Please not that I am something of an amateur with scripting.

View 6 Replies View Related

Server :: Apache Virtual Host To Limit The Concurrent Connections Of Virtual Hosts?

Jul 3, 2009

apache virtual host to limit the concurrent connections of virtual hosts? Taking into account the host of each virtual user's home directory can also have more than one subdirectory, which should be restricted to a subdirectory. Is beyond the control of the operation of these sites in a subdirectory. Best local restrictions or limitations to the overall situation.

View 1 Replies View Related

Server :: Debian Lenny - All Virtual Hosts Lead To First Virtual Host

Apr 21, 2010

I'm having an issue with setting up the virtual hosts on my web server. I have 2 virtual hosts (example1.com, example2.com). example1.com works but example2.com is sent to the index file of example1.com. I did some searching on google and it seems the problem might be with my /etc/hosts file.

First virtual host that the second is also directed to...in sites-available/sites-enabled (note port 80 is blocked by my isp so I use 8080)

Code:

Second virtual host file

Code:

And my hosts file

Code:

# The following lines are desirable for IPv6 capable hosts

Also I'm using a dyndns.org...would that make a difference?

View 2 Replies View Related

Security :: Virtual Server To Access The Main Host Or Another Virtual Se

Jan 8, 2010

Is there anyway for one Virtual Server to access the main host, or another Virtual Server? Or would they be totally 100% independent?

View 5 Replies View Related

Server :: Create A Virtual Host And Virtual Ip In Proftpd Centos?

Nov 22, 2010

I want to create a virtual host and virtual ip in proftpd linux centos. can anyone please help me on this,I'm new in linux.

View 8 Replies View Related

General :: Ssh From Virtual Machine To Main Host?

Mar 17, 2011

ok how do you add a rule which allows a virtual machine to connectto ssh on the main fedora host?so connecting from a virtual machine to the main fedora host installation? I think i have to use an iptables command but not really sure

View 3 Replies View Related

General :: How To SSH Into Red Hat System (virtual Box Guest) From Windows 7 (host)

Nov 11, 2010

I have RHEL running in Virtual Box and my native OS is Win 7. From a purely educational standpoint, I want to be able to access RHEL from Win 7 over SSH. I download putty but don;t know how to make it do what I want. Ideally, I would like to use the linux command prompt at a minimum and preferably access the GUI apps also. IS this possible? I am just trying to explore and expand my linux knowledge.

View 7 Replies View Related

General :: Apache Virtual Host Document Root ?

Sep 9, 2009

I'm now configuring my web server to server different Virtual Hosts based on DNS name. Right now I store my files in /var/www per the default installation settings in Apache.

Questions:
I want to change the Document Root to /home/username/public_html/example1.dyndns.org for the second virtual server. What do the permissions need to be in order for Apache to read the files in this location? Would it be best to force Apache to run as this new username instead of www-data?

My Virtual host setup will look something like this

I want to change the DocumentRoot as I am running a chrooted ProFTPd server and want to be able to update webserver files via FTP. I am running Ubuntu 8.04 LTS Server (CLI only).

View 5 Replies View Related

General :: How To Apache Identify For Which Virtual Host The Request Has Come

Jan 22, 2011

I'm having some basic doubt! Consider 5 virtual domains has configured under a same server. I mean 5 different domains under same IP. Eg. mydomain1.com and mydomain2.com have IP 208.27.1.89. So when web browser request for mydomain1.com name server return IP address 208.27.1.89. Then browser contact IP 208.27.1.89 on port 80. Here comes my question how does apache know that the browser is looking for mydomain1.com not mydomain2.com. How apache differentiate the request for it's virtual hosts? By the way, what is a virtualhost ?

View 1 Replies View Related

General :: Select PHP Handler Module Per Virtual Host?

Oct 20, 2010

I would really like to install 2 or 3 PHP handler modules (suEXEC, FastCGI, etc) on a single server and assign which module should be used per virtual host or domain or whatever.

Is this possible?!
Could I get details?

View 1 Replies View Related

General :: Force A Process To Run In Virtual Memory?

Dec 9, 2010

I am running a series of tests for an implementation of a remote pager that sends page faults to other computers in a network. Long story short, I was wondering if there is an easy way to force a process to use virtual memory as oppose to physical RAM so that I can better measure the performance of my implementation against how the system would perform while swapping to the hard drive.

View 4 Replies View Related

General :: Virtual Machine - Connect To Guest From Host PC Using Putty?

Feb 6, 2010

How can I connect to Linux (which is in a VM) from the host PC using putty? I can ping the 192.168.1.108 from my host PC. And there is sshd process running on Linux. I choose the SSH to connect, but gives error.

View 5 Replies View Related

General :: Bugzilla 4.0 Not Recognizing SetEnv Variable For Virtual Host?

May 26, 2011

I am attempting to stand up a new server Red Hat EL6 with Bugzilla-4.0 and everything is working expect Virtual Host. By defualt Bugzilla looks for SetEnv PROJECT (variable) in the /etc/httpd/conf/httpd.conf file. I followed the given instructions to place SetEnv PROJECT (variable) under <VirtualHost> however bugzilla doesn't recognize that it is there. When I put SetEnv PROJECT outside of <VirtualHost> then it becomes the default for ALL my different virtual host instead of using what is inside the <VirtualHost> section.

Here is the NameVirtualHost section of my httpd.conf file

NameVirtualHost *:443
SetEnv PROJECT UIDPMO
<VirtualHost 140.188.65.31:443>

[code]....

PS: Here is what Bugzilla 4.0.1 guide says to do: 2.4. Multiple Bugzilla databases with a single installation The previous instructions referred to a standard installation, with one unique Bugzilla database. However, you may want to host several distinct installations, without having several copies of the code. This is possible by using the PROJECT environment variable. When accessed, Bugzilla checks for the existence of this variable, and if present, uses its value to check for an alternative configuration file named localconfig.<PROJECT> in the same location as the default one (localconfig). It also checks for customized templates in a directory named <PROJECT> in the same location as the default one (template/<langcode>). By default this is template/en/default so PROJECT's templates would be located at template/en/PROJECT.

To set up an alternate installation, just export PROJECT=foo before running checksetup.pl for the first time. It will result in a file called localconfig.foo instead of localconfig. Edit this file as described above, with reference to a new database, and re-run checksetup.pl to populate it. That's all. Now you have to configure the web server to pass this environment variable when accessed via an alternate URL, such as virtual host for instance. The following is an example of how you could do it in Apache, other Webservers may differ.

<VirtualHost 212.85.153.228:80>
ServerName foo.bar.baz
SetEnv PROJECT foo
Alias /bugzilla /var/www/bugzilla
</VirtualHost>

Don't forget to also export this variable before accessing Bugzilla by other means, such as cron tasks for instance. For anyone that fell into the same trap as I did. The Bugzilla guide neglects to tell you where to set the SetEnv PROJECT variable. It turns out that you need to add this variable in the /etc/httpd/conf.d/ssl.conf file under each virtual host section. So for me I did the follwoing

<VirtualHost_default_443>
SetEnv PROJECT PDS

Save the file, restarted Apache and everything worked as expected. Although I did include the NameVirtualHost section in /etc/httpd/conf/httpd.conf I don't think it made a difference.

View 1 Replies View Related

General :: Forward Port For IP-Based Virtual Host To Work?

Mar 22, 2010

Having trouble visualising how IP-Based Virtual Host (with SSL) would work. Here is my vhosts.conf file:

Code:
#Define Name Virtal Host
NameVirtualHost 10.10.0.54:80
#Used to replace the main server host. The log file will reside in /var/log/httpd/error_log

[Code]....

How will it work? I will need to forward port 443 to the 10.10.0.55 interface right? Without doing that, there is no way this is going to work... is there? And that means that I can't run more than 1 ip-based SSL virtual host on one machine because I can't forward 443 to two different interfaces.

Also, do I use internal ip address or external ip address in the <VirtualHost > tag? I only have one static public ip.

View 5 Replies View Related

General :: Virtual Machines And Dual Monitors With A Windows 7 Host And Guest?

Oct 4, 2010

I'm looking for virtual machine software that supports dual monitors on a Linux guest with a Windows 7 host.VirtualBox supports dual monitors only for Windows guests. VMware Player was extremely slow, so I gave up. I'm not sure it supports dual monitors, anyway. Can anyone recommend a product for what I want to do?

View 1 Replies View Related

General :: Deploy Windows Server 2008 R2 In Virtual Machine On Host?

Jul 27, 2011

Will there be any issues installing and then subsequently running a Microsoft Windows Server 2008 R2 installation on a VirtualBox VM on a Linux host (Ubuntu 11.04 64-bit)? I require Windows Server 2008 R2 for a course I'm taking, and I dont have any systems to install/deploy it onto.

Host Machine Specs:

Ubuntu 11.04 64-bit
4GB RAM
350GB Disk Space
Nvidia Quadro system

View 2 Replies View Related

General :: Httpd Virtual Host Set To Mount To Samba Share Folder?

Dec 23, 2010

The scenario like this. I'm working on Ubuntu 10.10. I've enable samba sharing with full guest access enable. In my office I had another server (CentOS 5.5) installed just for me and I've created a Apache VirtualHost which root document pointed to share folder on my comp

This is my fstab setting
//my ubuntu computer name/sharing/www /media/www cifs context=system_ubject_r:httpd_sys_content_t:s0,username=username,password=******,iocharset=utf8,fi le_mode=0777,dir_mode=0777 0 0

After label the mount folder as httpd_sys_content_t the Apache web server working in correct way (duno much but at least it can index files and excute some php code so) then the troll come in : if some file was created by my ubuntu (personal comp) then the file would be listed in Apache virtualhost correctly.

But if I'm ssh to CentOS server goto /media/www which was mounted to my unbuntu computer. Then type command like $mkdir something Suprising that folder ./something could not be accessed by Apache anymore except I remount by umount and mount it again or "setenforce 0" What is wrong with my system can anyone point me out of this headache

View 1 Replies View Related

Programming :: Get A Password In A Bash Script For Mysql User Creation?

Apr 25, 2010

I'm trying to get a password in a bash script for mysql user creation. But sometimes a get a non-alphanumeric character(s) in the password, and mysql failes with that. I tryed with apg -EO0Il1`~!@#$%^&*()_+-=[];./{}|:"'<>? but failed. I tryed with sed 's/[^a-zA-Z2-9]//g' , but at that moment the minimum password lenght failed. I'm also fine when there is a better alternative then apg.

View 2 Replies View Related

General :: Bash Script To Get PID Of A Specific Process?

Aug 23, 2010

I'm trying to write a script that involves storing a specific PID in a variable. I've got as far as: -

Code:
$PS_OUTPUT=ps -elf | grep <process name> | awk '{print $4}'
This stored the PID of the grep itself and the actual process I want. The output of

[code]...

View 6 Replies View Related

General :: Bash Script That Read From File And Ping Remote Host

Feb 13, 2011

Q=What will this do?
A=This will read from /root/Desktop/iplist (or anywhere you want to put the list) after it reads the ip it will ping the ip two times. If the remote host is up then it will write the ip to a log. If the ping fails it will display it on the screen, write the ip to syslog so that you can do remote logging, and last it will send the ip by email to a user or a group of users.

Code:
#!/bin/bash
#wrote by Zach Underwood feb-12-2011
#test and wrote on centos 5.5 with sendmail
rm -f /root/Desktop/iplog #This will remove the good iplog
exec 9</root/Desktop/iplist #put full path the file where ip list is. Make sure that the ips are listed one per line.
while read -u9 ip
do
ping -c 2 $ip > /dev/null 2> /dev/null # ping and discard output
if [ $? -eq 0 ]; then # check the exit code
echo "$ip is up" >> /root/Desktop/iplog #write the ip of the hosts that are up
else
echo "$ip is down" # will show on the screen the ips that are not up
logger -p auth.notice "$ip is down" # will write the down host to syslog
echo "$ip is down" | mail -v -s alert user@anydomain.com > /dev/null 2> /dev/null #will send mail users about host down
fi
done

View 3 Replies View Related

General :: Bash Script - Check Process Is Running, If Not Start?

Feb 7, 2010

I am using Sphinx search on my webserver and it quits after a certain amount of time leaving my search page broken.Here is a bash script that I want to run every 10mins via cron:

Code:
#!/bin/bash
if pgrep searchd | grep "[0-9]"

[code]...

View 24 Replies View Related

General :: Create BASH Script To Process Multiple Inputs On Read

May 26, 2010

First post from a very new Linux user....I am trying to create a BASH script that will allow user to provide multiple directory names, Checks if the directory exists and if not create the directory.

I am using the following code:

Which works fine as long as the user enters a single directory name. How can I modify this so it will process all directory names user enters on the read response?

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved