473,788 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copy apache logs Ubuntu 7.10

11 New Member
Hi i am using php 5.2.3 on Ubuntu 7.10 and apache 2.2.4.
i have just switched from windows 2000 and have encountered a problem with my log viewer script unlike windows i cannot just open the apache log file with php as it is always being used by apache. now i can copy using command line:
cp /var/log/apache2/access.log /var/log/apache2/access.log.copy

I need to do this in php but i don't no how.

Please help

Thanks Scott.
Nov 18 '07 #1
2 2113
pbmods
5,821 Recognized Expert Expert
Heya, Scott.

Check out the copy() function.
Nov 18 '07 #2
ratcateme
11 New Member
Thanks for the reply.

I put this is my code
[PHP]copy('/var/log/apache2/access.log','/var/log/apache2/access.log.copy ');[/PHP]
but i gets a error again because the access.log file is in use by apache.
i dont n o any shell scripting but i think that is what i need to copy this file i tried using this cimmand but i dont think the syntax is correct
[PHP]$cmd='cp /var/log/apache2/access.log /var/log/apache2/access.log.copy ';
echo exec($cmd);[/PHP]

Scott.
Nov 19 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
14169
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip Smarty-2.6.7.tar.gz on a system running WindowsXP SP2. Apache and PHP tested out fine. After adding Smarty, I ran the following http://localhost/testphp.php
19
5257
by: Alex Madon | last post by:
Hello, I am testing a web application (using the DBX PHP function to call a Postgresql backend). I have 375Mb RAM on my test home box. I ran ab (apache benchmark) to test the behaviour of the application under heavy load. When increasing the number of requests, all my memory is filled, and the Linux server begins to cache and remains frozen. ab -n 100 -c 10 http://localsite/testscript
3
1747
by: 99m | last post by:
I used to have Apache and PHP4 working perfectly in Ubuntu Hoary Linux. I upgraded to Ubuntu Breezy Linux and I either get one of the following problems: "You don't have permission to access /testsite/index.php on this server." or, if I put a test.php in the root, and try to run it, I get a Firefox dialog that's sort of like, "What do you want to do with this file? View it in gedit (notepad)?"
1
2486
by: sysxperts | last post by:
Hello, Having an issue that is specific to PHP compiled with PGSQL support with versions noted in subject line. I understand that there are many variables to consider here but believe I have narrowed down the Apache Client Cert failures to my PHP/PGSQL build. 1. Apache PHP without PGSQL works as expected using client certificates 2. Apache PHP with PGSQL works fine with standard SSL connections 3 Apache PHP with PGSQL fails with...
5
5521
by: msuemnig | last post by:
I've create an Ubuntu Linux box, which comes pre-installed with Python (I've added the libapache2-mod-python throught the app manager). I've created .cgi and .py simple programs in the www root of apache. The problem is the programs just dump the contents to the browser in plain text. Or, in the case of the .py files, I am prompted to download the .py file. How can I get apache to recognize that it should execute the .cgi script? ...
5
5697
by: voronwae | last post by:
Hi folks. Either I'm missing something really obvious (most likely) or I'm missing something really subtle. I've been building up a machine as an IMP webmail server, with php 5.1.2, cyrus-sasl, openldap, imap, fileinfo, mod_perl, sqlite, horde, Berkeley DB and PostgreSQL, among others, on top of an old Potatoe machine that was already alive and in production so I just went with it. Everything worked great up until the installation of...
1
4681
by: wadacom | last post by:
I'm sorry to take your time for newbie problems but I've been searching what to do about the problem with my apache server I have. I work with ubuntu dapperdrake I put the last apache server on it and I tried to put the mod_python module to work. the only answer I got was that apache didn't find api structure in the module. afterwards I read I didn't need this module to work with python (only a speed difference as I understand) but the problem...
0
6857
by: phil469 | last post by:
I'm having an issue when trying to read a file in a user's homedir from a cgi script. I have a virtual host section in my httpd.conf file which I'll include. The cgi script is a very basic script written in Perl just for testing. I believe I need to find the correct <Directory> entry or some other Directive in Apache to make this work, but I've had no luck for a week now. I've tried many different things, but w/ no luck. I even tried adding...
3
2579
by: brundlefly76 | last post by:
I am using the apache-perl webserver in Feisty (an Apache 1.3 with mod_perl enabled), which works fine, but I cannot figure out how to install php5 into this webserver as well. Here's some stuff I have tried from the docs and googling: sudo apt-get install php5 This seemed to only work for apache 2. sudo apt-get install libapache-mod-php5
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10118
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5403
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4074
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2897
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.