Simpleish PHP/flat Files - Create File, Edit, Save

Nov 24, 2007

Display some text in a web browser from a file called text.txt

text.txt will have many lines and some of them I do not want users to be able to modify and overwrite.

config_item_1=user can edit
config_item_2=user should see but not edit (could be on any line)
config_item_3=user can edit
config_item_4=user can edit

The user has made their changes in the web browser and clicks submit. I then need this info to be saved as the text.txt file however some checking needs to be done first. Anything matching config_item_2 should be removed. This could be on any line. Anything not matching should be permitted and added.

View 1 Replies


Save Grep To Txt File

Jan 28, 2008

I grepped an IP address on a domain log and it showed thousands of lines. How do I save this grep result to a txt file so I can send it to someone?

View 4 Replies View Related

How Can I Save My /etc/passwd File

Nov 3, 2007

how can i save /etc/passwd there is many linux order which show my users on server
such as :

cat /etc/passwd
cat /var/cpanel/acounting.log
ls -la /etc/valiases
ls /var/named

and how can i disable the geting orders
such as :

curl -o

View 8 Replies View Related

Simple Perl Progam To Save Server Load Every 30 Minutes To A File

Sep 2, 2007

i use the following perl script(created by me) to save server load every 30 minutes to a log file i just keep it running in the background(probably would be more effective using cron)


while(1) {
$w = `w`;
#print $w;
$w =~ /load average: (.+)
$log = $1;
my ($sec, $min, $hour, $mday, $mon, $year) = localtime;
my $rightnow = sprintf("%04d-%02d-%02d %02d:%02d:%02d ", $year + 1900, $mon + 1, $mday, $hour, $min, $sec);
$log = $rightnow . ": " . $log ."
open (OUTFILE, ">>top_logfile.txt");
print OUTFILE "$log
close (OUTFILE);
#sleep for 30 minutes

View 11 Replies View Related

Edit /etc/my.cnf File

Nov 8, 2008

I am trying to edit my database parameters by editing my /etc/my.cnf file. However I am new to SSH and can't seem to get this working. The parameter I wants to change in /etc/my.cnf file are as follows
max_connections 600

View 10 Replies View Related

DNS File Edit

Apr 27, 2008

For DNS changes I use only CPANEL to edit.

Now I need to make massive changes to some parameters ( like contact email, remove some lines unset e.t.c)

How can I edit the file with dns records and make the change easy and massive?

View 3 Replies View Related

How To Edit Php.ini File

Jul 10, 2007

I got a problem with my software . . . because the cpanel upgrade caused some problems and need to edit the php.ini file. . .

View 7 Replies View Related

Plesk 12.x / Linux :: Downloading Backups To Local Computer - Save File In TAR Format?

Jul 27, 2014

If I try to download a plesk backup to my local machine it saves a file a few bytes in size in .xml.tar.html format

My other non plesk 12 machines correctly save the file in .tar format ....

View 11 Replies View Related

Cannot Edit/view Files In Any Directory

Sep 14, 2008

Command: CWD /public_html

Response: 550 Can't change directory to /public_html: Permission denied
Error: Failed to retrieve directory listing

That's what I see in FTP, but in File Manager in cPanel I don't see any files.

What do I do?

The permissions is set to 750 for /public_html and I cannot change them

View 14 Replies View Related

How To Edit DNS Zone File In CPanel

May 31, 2007

I have been using Site5 hosting and its pretty easy to edit DNS Zone file .. Now I have some sites hosted with HostGator and they have cPanel.

I am wondering how to edit dns zone file in cPanel? I don't have WHM with my account.

View 8 Replies View Related

Can I Edit Iptables Config File And Update It?

Dec 13, 2008

how can i edit iptables config file and update it?

because my server is under DDos attack.

View 8 Replies View Related

Plesk Automation :: Postfix CA Bundle File Under PPA - How To Edit Without Risk Of It Being Overwritten

Aug 19, 2013

I see in the maillogs a number of errors lots of different Certificate Authorities - and some I really did NOT expect to see here:

[root@web48002 admin]# grep ' certificate verification failed for' /usr/local/psa/var/log/maillog | wc -l
[root@web48002 admin]# grep ' certificate verification failed for' /usr/local/psa/var/log/maillog | head
Aug 19 00:04:45 web48002 postfix/smtp[28115]: certificate verification failed for[]:25: untrusted issuer /C=US/O=Equifax/OU=Equifax Secure Certificate Authority

[Code] ....

How/where do we edit our CA file under Postfix - and why is the standard one installed by PPA not including some of these VERY MAJOR CAs?!?

I would like instructions on how to edit this in a manner that it will not get overwritten by some PPA update or yum update.

View 3 Replies View Related

IWeb8 Technologies - A Flat Out Nightmare

Mar 11, 2008

I warn you, there is not a single good thing to be said about iWeb8 after our vast experience with them so if you want cliffnotes, picture a man shuffling through around 100 emails, invoices and chat logs while screaming in frustration. I’m attempting to piece together a structured account of our experience at iWeb8 Technologies through all that so bear with me here.

We run a non-commercial website that receives around 20 million page views per month. The problem is we quickly outgrew our technical know-how and had a pickle on our hands once our dedicated server at HostGator started buckling under the pressure. Friday is our most active day, as that’s when we have new content for our members – it’s also the day when our server became virtually inaccessible due to the traffic. We needed a solution, because HostGator basically told us to upgrade our machine or stop bothering them, [click here] for that story.

We narrowed our choices down to 2, SoftLayer or iWeb8 Technologies. We called them both up and learned about their datacenters and what direction we should go with our situation. SoftLayer’s salesman misunderstood a bit (as we later learned, more on that later) and offered us an overwhelmingly costly setup (upwards of $1500+ per month). iWeb8 ‘s sales representative “Brian” reeled us in with a couple promises –
1)The solution they outlined to us (2 web servers, 1 database server) would work.
2)If we opted for Level 5 management ($149/month) they would “treat our servers as if they were their own” (word for word)

We were very excited and worked out the details with them. We were convinced to go with a 12 month plan which would save us money in the long run. Our server manager suddenly switched from “Brian” to “Patrick Bertrand” at that point. And then the problems started.

The very first Friday we were fully set up on their servers, we crashed. We crashed under less traffic than our single cheap dedicated server at HostGator handled. It took iWeb8 1 hour to reboot our server. The next Friday, we crashed. We were down for 3 hours before we were rebooted. On 11/08/07 We asked for a hardware diagnostic and an inquiry into why we were crashing with pretty much twice the power we previously had – they told us we should add 2GB more ram to our servers for $50/month each.

We had them install the 2GB on one server to do them in phases, and thus minimize downtime. After the installation of ram that server performed far worse than it ever did before, and shot up to 100% CPU usage with 1 user online. This was my first experience with the post 6 PM Janitors who man their support staff. Apparently after that timeframe all the knowledgeable techs go home. After hours of waiting and talking on live chat / phone (to the same person every time, the only person who answered…) I was basically told that nobody there could do anything and I would have to wait until 8 AM EST for a senior technician to look at it. OTHERWISE, I could pay $180/hour or some ridiculously high number to get it immediately looked at. That Level 5 support really pays for itself huh?

I hired an emergency outsource administrator to look at it, he quoted me at $200 until the problem is resolved which was a steal. He found that I didn’t need ram at all. It was in fact my faulty motherboard that was causing the problems on that server. Ooooooh! Thanks for doing your “hardware diagnostic” properly and telling us to upgrade our ram for $50/month iWeb8, you’re really looking out for your customers. Finally at 12:15PM EST noon the next day it was looked at and replaced.

Exactly 1 week later on 11/15/07 all of our servers went offline for an hour or two. We were told it was a network issue and it was resolved. Nice.

Now here’s where the monster problems started. On the evening of Tuesday 12/01/07 all of our servers went offline. We opened an emergency ticket and the Janitor responded saying 3 apache modules were missing (huh?) and that it was fixed. Thing is, it wasn’t fixed at all. All 3 servers were still offline and unreachable. Finally our outsourced server admin gets into one of them and sees the load at 150+ with a ton of httpd threads open. He runs netstat and concludes we’re being DDoS attacked. Swing and a miss again, iWeb.

After exchanging pleasantries with the Janitor all night the senior staff finally got in at 8AM. His conclusion was to shut down apache and wait it out, since iWeb8 has no DDoS mitigation systems. Great. 2 days pass and nothing improves. We talk with our server manager to find out if we can terminate our contract and take our business elsewhere due to the pile of [expletive deleted] they’ve dumped on us ever since signing us, and the uselessness of “Level 5” support. He responds saying, and I quote

“Concerning level 5 support, have you requested the monitoring service alerts to be sent to our sysadmin cell phones ? if you did please provide the original RT number so that i can investigate to see why it has not been done on our side”

Wonderful. So you’re basically paying for nothing until you use your psychic powers to determine that you need to request something you thought was assumed with your $149/month. Nowhere when we signed up were we told we had to submit a ticket to request that our Level 5 support is useful. He also mentioned that the original salesman was “wrong” in offering us the phrase “we treat your servers like they’re our own”.

He responds again saying the website is working from his side. We test from 3 ISPs and proxies and we can’t connect, so no, it’s not working. Our server admin determined that their solution involved blocking pretty much all incoming traffic except their own range. We once again requested that the contract be terminated, as we were blatantly lied to on multiple occasions and they’re threatening our website with their poor level of service. He says he needs to discuss it with the higher ups.

At this point I’d already moved my sites to a 2 web server 1 database setup at SoftLayer, they put my site under their Cisco Guard and their team actively worked against my DDoS attack, ending it within a few hours. I’ve been happily at SoftLayer ever since 12/5/07 without any issues on this setup. See my review of them by [clicking here].

Anyway, on 12/17/07 iWeb sends a global email to all their customers informing them that “Improvements will be made to night and weekend customer service”, thus admitting that they were actually manning their Janitors – too little too late though.

On 01/15/07 we still hadn’t heard from them (except for a couple dozen invoices that failed because we weren’t going to send them anything until this was finalized), so we talked to our lawyer and threatened legal measures on iWeb8 if we didn’t hear from them so that we could terminate the contract. On 01/16/07 we got an email from Patrick Bertrand confirming that the contract could be ended, they would send us the details later.

Turns out the details was they wanted 20% of the remaining contract value to terminate, which he ensured me was a “good deal” because “he knows his company and this is the lowest they’ll go”. Is he trying to sell me a car or what? At this point it’s whatever, if we can pay $1,495.26 (20% of the remaining contract) to make the iWeb8 nightmare end, let’s do it. So we did, on 01/25/08 we paid the entire amount and our contract was effectively terminated.

Now in March the nightmare returns. We receive an email from them demanding that we pay $740.00 for “services” rendered from the period of when he said he’d talk to the higher ups till we were waiting for them to do virtually nothing until we called them up in January.

At this point we’re weighing the option of paying off these swindlers and being done with it once and for all (even though they’ll probably come back to us in June with “interest” invoices on this current one) against fighting it. That’s where we’re at now… I hope this was enlightening for you if you’re considering falling for iWeb’s lies, random surcharges and all in all horrible service.

View 14 Replies View Related

Links Files In Linux (file.txt For File.php)

Jul 9, 2007

Today I found some cstomer on the servers make a link for named it file.txt and link it to other customer php file.

so that customer have the ability to show the other custoer file content when visiting the url because it is a text wile originally it is a php file.

the php file was a config file, so now he know the database password , and because he is in the same server he can use that databse.

the question , how to avoide this prolem in the future?

notes , the SuExec is rnning and the open_basedir protection is enabled, but the problem still exists.

View 12 Replies View Related

How Do You Create/generate Config Files

Jul 10, 2009

When deploying new server/servergroup/cluster to your IT infrastructure, deployment (simplified) consist of following steps:

OS installation: to do it over network, boot server must be configured for this new server/servergroup/cluster,

configuration/package management: configuration server has to be aware of the newcomer(s),

monitoring and alerting: monitoring software must be reconfigured,

performance metrics: a tool for collecting data must be reconfigured.

There are many excellent software solutions for those particular jobs, say configuration management (Puppet, Chef, cfengine, bcfg2), monitoring hosts and services (Nagios, Zabbix, OpenNMS, Zenoss, etc) and performance metrics (Ganglia, etc). But each of these tools has to be configured independently or at least configuration has to be generated. What tools do you use to achieve this?

For example, when you have to deploy a new server, how do you create configs for, let's say, PXE boot server, Puppet, Nagios and Ganglia, at once?

View 2 Replies View Related

Mysql Cannot Create File In /tmp

Feb 3, 2008

I always have this error with mysql

Can't create/write to file '/tmp/#sql_7042_0.MYI' (Errcode: 13)

the /tmp has been chmoded 1777. I installed mysql downloaded from rpm on, version 5.0.51a 64bits for CentOS-5

View 9 Replies View Related

How Do I Create A Daily Copy Of Just One File

Jul 3, 2008

I seem to be having a problem where periodically the data in one file is getting corrupted. I haven't been able to figure out a pattern to it, so I wanted to run command by crontab that would create a copy of the file each day. To avoid overwriting previous backups the filename of each day's copy would have to be unique like...

cp filename filename-2008-07-03

Is there a way to include this year, this month, and this day variables in a linux command?

View 6 Replies View Related

Apache :: Can Have HTAccess File Which Create Links

Mar 16, 2013

In my personal website at URL.... I have the top like 'index.php?pg=profile', 'index.php?pg=home' or 'index.php' (without any querystring), 'index.php?pg=diary' etc. I am looking to see if I can have .htaccess file which can make me create links like


write an .htaccess for the same?

View 1 Replies View Related

Wordpress Drupal Wont Create Files On Server Lamp

Apr 6, 2009

I built a web hosting server, the following is its state

Cent os 5
AMP server loaded updated (installed it as a complete suite during installation so it was all set to go with php mysql modules loaded)
usermin virtualmin

created 2 named based hosts.

now when i load up wordpress in a site and try to run install.php

the following pops up

"Sorry, I can't write to the directory. You'll have to either change the permissions on your WordPress directory or create your wp-config.php manually."

I had this issue before and research said to redo the entire server (tried everything and was fed up had fedora then"

you can have a look at just click create config file and the errror pops up.

The php and mysql db work great on simple scripts but i dont know why this happens.

i worked with assigning the users and apache user to the directory and everything, no joy.

View 6 Replies View Related

MySQL Error: Can't Create/write To File '/dev/shm/MYxQT8lz'

May 19, 2008

one of my site shows this error

MySQL Error: Can't create/write to file '/dev/shm/MYxQT8lz'

I checked space on the server is still 25 GB free,

View 1 Replies View Related

Apache :: How To Create Dump File For Crash In Windows

Jun 19, 2014

how to create Dump File for Apache Crash in Windows.We are using Apache for Reverse Proxy with OpenAM Module for Sign-in.Apache Version : are very frequently facing Apache Crash Issue.

Also in logs we do not get much information.when submitted logs to ForgeRock, they asked us to look into below error and provide Crash Dump.

[Sun Jun 15 23:00:10.153908 2014] [mpm_winnt:warn] [pid 2376:tid 424] (OS 64)The specified network name is no longer available. : AH00341: winnt_accept: Asynchronous AcceptEx failed.
[Sun Jun 15 23:02:21.609557 2014] [proxy_http:error] [pid 2376:tid 6544] (OS 10060)A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. : [client 10.XXX.XX.XX:XXXX] AH01095: prefetch request body failed to XX.XXX.XX.XX:XXX ( from XX.XXX.XX.XX (), referer:

View 9 Replies View Related

How NOT To Require CHMOD 755 Permissions To Create, Write And Delete Files On Linux

Dec 30, 2008

On my previous server and on some other hosts, I was able to write to files (for example with PHP) without having to chmod the files first.

Now I cannot, and files are required to be chmoded properly so I can write to them.

I cannot even touch() a file with PHP.

Is there any way to have this permissions removed?

I don't want to chmod the all thing, all I want is to change the configurations so I can fwrite() or file_put_contents() normally.

I's a dedicated un-managed server, so basically any advanced configurations can be done.

View 8 Replies View Related

Prevent PHP Files Used For File Uploading

Jul 3, 2009

It appears that some people like to take advantage of those files for online web applications such as Wordpress which have php files with permissions set to 777. They use those as a means of creating an upload file. The upload files that they create then have access to the whole server somehow... Is there anyway of preventing this from happening?

View 8 Replies View Related

Domlog File And Rawlog Files Are Same

Jan 8, 2007

Does domlog file and raw access files are same? I mean do the contains same contents?

View 0 Replies View Related

How To Chmod The Files And Subfolder + File.php To 755

Jun 25, 2007

i download a script .. when i unzip the script .. all the folder have chmod to 700 + 600

what command could let the folders and sub folders have chmod to 755 ( as root )

i command this

chmod 755 *

but the folders inside the folder didn't chmod to 755

there is alot folders thats why its hard to do it manually :p

View 7 Replies View Related

Use .htaccess File To Allow Access To Zip Files Only From My Script

Feb 18, 2007

I have download manager script that I use for my customers to download products right after the purchase.

Script generates download link that looks like this: (where 2YY6582921B is receipt number that is different with each purchase).

All products are placed in one folder. This folder can not be seen in above download url, but can be accessed thru browser and files can be downloaded that way without paying for them.

Can I use .htaccess and if yes how, to protect all product files the way that they can not be accessed directly by visiting url thru browser (in case somebody will find the correct url), they should be allowed for access only for my download manager script.

View 3 Replies View Related

SSH Or Program How To File Replace Lots Of Files

Jan 14, 2007

I have anywhere between 80,000 - 90,000 webpages that have a single code into this. Unfortunately at the time the web developer I used didn't use PHP includes. So each .html file has the code in it.

I want a way so I can do a single command either a program or an SSH command can find the syntax in the files and replace it will code I have. Its just a single line of code that is basically for an adsense code, so the pub-blahblahblah etc..

Does anyone know of a SSH command I can use, or a program that will find and replace without manually opening up each file? 80k - 90k of opening files then find/replace will take forever!

View 11 Replies View Related

WHM Not Listing Account, DNS Etc, Missing Files, File System

Jul 26, 2009

I recently had an issue where my box wasnt listing accounts (on logging into WHM for the first time it would, thereafter browsing different functions in WHM it would fail to list any accounts), would not list any zone items when editing DNS zones and in general was acting very strange.

I think the tech support chap narrowed it down to zero free inodes on the filesystem (i was even getting errors when editing files with 'vi'). This was increased for the VPS and all issues seemed to be resolved...

However named and httpd were not starting after reboots. Again on looking closely named and httpd were missing from /etc/init.d (on CentOS 5.3)! This is very strange and i certainly didnt modify those nor delete such critical files.

For a second opinion, is there any cPanel script that can be ran to fix the issues, i am concerned other things have been affected but havent manifested themselves yet (other files deleted etc). Does cPanel update script create the init.d files or is this done by the CentOS operating systems itself? Are these files modified during a cPanel update script?

These init.d files for named and httpd have been readded (copied across from another box) and it seems to be ok again, but ideas on howto proceed much appreciated, as i mentioned i dont want any nasty supprises!

View 2 Replies View Related

Copyrights 2005-15, All rights reserved