FAQ Database Discussion Community


Copy file to server with specific port using scp in Linux [closed]

linux,centos,port,scp
If I want to copy file from server to my local OS I use this: scp -P 60385 [email protected]:/myserver/somefile.txt /mylocaladdress/. But how do I do the opposite? I tried this: scp /mylocaladdress/somefile.txt [email protected]:/myserver/. -P 60835 And this: scp /mylocaladdress/somefile.txt -P 60835 [email protected]:/myserver/. But I'm getting this error ssh: connect to...

installation of compiler gfortran in centos 6

gcc,centos,centos6,gfortran
I try to install some compilers. I use Centos 6 in my laptop. I have installed the gcc, the "GNU" C Compiler. I need to install also gfortran, but when I type yum install gfortran, I get the message no package gfortran available. Do you know how can I install...

erl with centos “Failed to create main carrier for ll_alloc”

linux,centos,rabbitmq,vps,erl
i am having a centos vps. i have installed erlang by the command rpm -Uvh erlang-17.4-1.el6.x86_64.rpm Now whenever i try to run my rabbitmq-server. or i just issue erl command then i get this error. Failed to create main carrier for ll_alloc Aborted is it some memory issue erlang is...

Centos 7 and systemd: CPU Quota?

centos,centos7,systemd,cgroups,resource-scheduling
OS Version Information: [[email protected] system]# cat /etc/redhat-release CentOS Linux release 7.1.1503 (Core) Configuration for the test.slice is as follows: [[email protected] system]# cat test.slice [Unit] Description=Test Slice Documentation=man:systemd.special(7) DefaultDependencies=no Before=slices.target Wants=-.slice After=-.slice [Slice] CPUAccounting=on CPUShares=1024 I created another file just like this (call it testhigh.slice) and gave it CPU shares =...

Bind named DNS error EOL

dns,centos
I am getting the following error, been trying t track it down with no luck. Any ideas? Error in named configuration: dns_rdata_fromtext: acme8.lcl.zone:2: near eol: unexpected end of input acme8.lcl.zone:3: unknown RR type '3600' zone acme8.lcl/IN: loading from master file acme8.lcl.zone failed: unexpected end of input zone acme8.lcl/IN: not loaded...

Configure linux asterisk for inbound calls

linux,centos,asterisk
Would anyone please help me figuring this out: I have configured Asterisk in Linux CentOS 5. I can make outbound calls from my sip phone in windows machine using asterisk server. But I need to receive incoming calls. My ISP provided me 4 information. Username, Password, domain name & DID...

Slow CURL CentOS7 with “same” link

curl,dns,centos,hosts
I just installed CentOS7 (3.10.0-229.4.2.el7.x86_64) with nginx (1.8.0). Here my hosts file: [[email protected]_main1 ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 127.0.0.1 arm.site.com kpp.site.com w.site.com server.site.com And problem: [[email protected]_main1 ~]# time curl http://arm.site.com/test/fad/site/site?siteId=152 {"OK"} real 0m0.162s user 0m0.003s sys 0m0.003s [[email protected]_main1 ~]# time curl...

Cannot find a package in yum repo list

tomcat,centos,yum
I'm looking for tomcat-native (Centos 6) $sudo yum install tomcat-native No package tomcat-native available. Error: Nothing to do How do I update the yum repository list?...

CentOS Shell Scripting elif error

bash,shell,scripting,centos,centos6
I cant get this script to work, returns error arround the first elif, can anyone help me pls ? #!/bin/sh /var/www/vhosts/website/httpdocs/ffmpeg -i $1$2 -s qvga -vcodec libx264 -acodec aac -strict experimental -ab 64k -ac 2 -ar 44100 -f mp4 -b 384k -r 25 -movflags faststart $1com_$2 if [ "$6" =...

unable to start terracota

centos,ehcache,digital-ocean,terracotta
I'm having issue when starting terracota, I did grep on 37.139.24.150 ip in whole system but couldn't find any file containing this IP, any other places to look for? Also i couldn't find tc-config.xml in terracota its actually an old system I'm just starting terracota its not installed/configured by me....

aid the corrupted file (binary) in CentOS [closed]

linux,centos
Help fix my mistake! I have damaged the binary file route. Is it possible to reinstall daemon that contains this binary file "route" ? How to do this?

phpseclib loadKey works on mac, not on CentOS

php,centos,rsa,phpseclib
I am attempting to load a hardcoded (for the sake of testing) RSA public key in phpseclib (stable version 0.3.10). This code works perfectly correctly when run locally on my Mac and spits back out the key I entered: CONST PUBLIC_KEY = '-----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDYwTO/CJJQ8vbwTRQRWmOS0Pbz tFCks4RhmPxYANSQV5V9Qy+QSupewn2WAb7zV04r4RqtwxB7stDMbK+uPY+GYR5M moQuT0YStJ6TXJjiF8i1Y+DBGLnTXOD36y93V8DpuFWMxMYtROskE+Mx1W70+VTZ EM6k+jvIfzRJoVDqswIDAQAB -----END...

Access denied while running Mysql for the first time on Centos

mysql,centos,root
I just installed Mysql for the first time on a CentOS machine using yum. The installation had no errors. Then I followed those steps: $ sudo /sbin/service mysqld start --skip-grant-tables --skip-networking $ sudo /usr/bin/mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE!...

Installing libxslt on CentOs 6.5

python,centos,yum,libxslt
I am trying to install lxml using pip which gave me errors as libxml2 and libxslt were not installed. I tried installing them using yum. libxml2 was successfully installed but nothing happens when I give sudo yum install libxslt. The output is as follows [[email protected] Downloads]# yum install libxslt Loaded...

How to check all versions of python installed on osx and centos

python,linux,osx,centos,version
I just started setting up a centos server today and noticed that the default version of python on centos is set to 2.6.6. I want to use python 2.7 instead. I googled around and found that 2.6.6 is used by system tools such as YUM so I should not tamper...

Iptables not loading new rules after restart Centos

bash,centos,firewall,iptables
I've created a bash script that adds a rule to the iptables firewall Example iptables -A INPUT -p tcp --dport 8080 -j ACCEPT Problem After a restart this rule is not applied What is the best way to save and apply the rules in bash script ...

Knife ec2: need to avoid re-boostraping of server after hostname change

amazon-ec2,centos,chef,hostname,knife
I might be doing something wrong, but here is the situation. Standalone Chef server 12.3.0. CentOS 6.3 running on AWS. During execution of knife bootstrap I am applying hostname:default recipe to change server's FQDN along with some other recipes. Everything iseems to be fine. Chef server shows newly boostrapped instance,...

Failed to open stream on file_put_contents in PHP on CentOS 7

php,apache,centos,centos7
I know this is a common bug with many threads but I'm tired of searching and I still haven't solved it. When I try to run the function file_put_contents I get the following error: Warning: file_put_contents(test.txt): failed to open stream: Permission denied in /var/www/html/nurses/adminWriter.php on line 29 I've already done...

How to reboot CentOS 7 with Ansible?

centos,ansible,centos7
I'm trying to reboot server running CentOS 7 on VirtualBox. I use this task: - name: Restart server command: /sbin/reboot async: 0 poll: 0 ignore_errors: true Server is rebooted, but I get this error: TASK: [common | Restart server] *********************************************** fatal: [rolcabox] => SSH Error: Shared connection to 127.0.0.1 closed....

How to stop Centos 7 Desktop returning to Login Screen after a successful login?

linux,login,centos,centos7,gnome-3
So I just did a fresh install of Centos 7 with the desktop. After the install, I installed my development environment and when to attach my windows ssd, but was told it needed to be shutdown instead of hibernation. So I restarted my system, booted into windows, and hit shutdown....

Subversion Server Using Active Directory

linux,svn,active-directory,ldap,centos
I am running a Linux server under VMWare Workstation 11 for subversion control. I also have a Windows Server 2012 R2 domain controller running under another VM. I am using CentOS7 and want to configure the authentication to use active directory. My CentOS7 server is already joined to the domain...

Install php-devel

php,centos
I would like to install php-devel on my server(CentOS 6.5). yum install php-devel However, I encountered the following error. Error: php54-cli conflicts with php-cli-5.3.3-40.el6_6.x86_64 Error: php54 conflicts with php-5.3.3-40.el6_6.x86_64 Error: php54-common conflicts with php-common-5.3.3-40.el6_6.x86_64 You could try using --skip-broken to work around the problem You could try running: rpm -Va...

Error with MySQL Instalattion in Centos 6.4

mysql,centos,libmysql
I'm trying to install MySQL in my CentOS 6.4 (X86_64) with the command: "yum install mysql mysql-server" And I'm having problems with the installation, the error presented is the following: Check the error log in the following link http://pastie.org/10022423 Any Idea why this error ? thanks for you helps!...

Centos 7 / Apache / PHP - mkdir(): Permission denied

php,linux,apache,unix,centos
Before you yell DUPLICATE! and banish me into the abyss, hear me out. :) I've been developing an intranet site for the company I work with, and originally I was developing it directly from my workstation running Windows 7 / IIS. As I've neared completion of the site/applications, I was...

Can Django be configured without httpd.conf modifications?

django,apache,centos,virtualenv,wsgi
So I had someone working with me who setup the server functionality of the Django site. It is working great directly on the IP in the browser. So we just finished building the site, and want to hook up the domain. I checked /etc/httpd/conf/httpd.conf and that file has nothing related...

PhantomJS fonts kerning issue

fonts,centos,phantomjs,kerning
Certain fonts letter spacing are mostly not symmetric - even have no gaps at all in some cases. The Server is "CentOS Linux release 7.0" (Had an older server version and this version gives better results but still not a good one) phantomjs version is 1.9.8 The html that I...

WkHTMLtoPDF 0.12.2.1 PHP exec xvfb-run: Error: xauth command not found

php,centos,wkhtmltopdf,xauth
I want to generate a PDF from a URL, so I execute the command by WkHTMLtoPDF as below: /usr/bin/xvfb-run --server-args="-screen 0, 1920x1080x24" /usr/local/bin/wkhtmltopdf http://www.google.com /tmp/google.pdf 2>&1 The above command works fine on Terminal, But when I invoke the command inside PHP failed! And show me an error message as below:...

WordPress.org and Vanilla Forums on 1 VPS

wordpress,dns,centos,forum,vanilla-forums
I am looking at setting up a blog and a forum. I will be using WordPress.org for the blog and Vanilla Forums for the forum. I could buy two VPSs but if I can get it to work on 1 VPS then that would be better. I would like to...

FIPS integrity verification test failed when iniating SSH session

ssh,openssl,centos,centos6,fips
I recently enabled the FIPS module under CentOS 6 (minimum install). Module is confirmed working: cat /proc/sys/crypto/fips_enabled yields 1 openssl md5 somefile(fails) and openssl sha1 somefile(succeeds). openssl version yields OpenSSL 1.0.1e-fips 11 Feb 2013 When I attempt to ssh into a box I connect to daily, I now see a...

Warning everytime login remote server

linux,ssh,centos
The following warning shows up everytime when I login a remote server using ssh [email protected]_server, anyone knows why and how to fix it? Warning: the RSA host key for 'HOSTNAME' differs from the key for the IP address 'IP ADDRESS' Offending key for IP in /home/haifzhan/.ssh/known_hosts:15 Matching host key in...

Point domain to wordpress folder in ec2 amazon centos

wordpress,amazon-web-services,centos,httpd.conf
I have my site hosted at http://52.68.178.242/ I have registered domain gabifrc.org from aws I'm using httpd24 on crentos I have set following configurations in /etc/httpd/conf/httpd.conf file. It seems to change the DocumentRoot but doamin is not in use. How can i point it to the doamin. <VirtualHost *:80> ServerAdmin...

bash: ./loopy: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

linux,centos
i have installed "Loopy" programme in Linux CentOS, but when try to run it said : bash: ./loopy: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory How to set path for this?...

pg gem install fails, cannot find libpq-fe.h header

centos,capistrano,bundler,pg,centos7
Whenever I run bundle install on my VPS (CentOS Linux release 7.0.1406 (Core)) I get an error when installing the pg gem. No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config checking for libpq-fe.h... no Can't find the 'libpq-fe.h header *** extconf.rb failed *** Could not create...

db:migrate (PostgreSQL) fails on Rails deployment with Capistrano

ruby-on-rails,centos,web-deployment
I'm a complete noob to deploying Rails and even more new to PostgreSQL. I'm running a CentOS 6.6 server and my deployment tasks keep failing with the following db:migrate errors: cap aborted! SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: rake exit status: 1 rake stdout: /var/www/rally_app/shared/bundle/ruby/2.2.0/gems/fog-1.23.0/lib/fog/rackspace/mock_data.rb:42: warning: duplicated key at line...

Why my scheduled job is not working?

linux,centos,crontab,vertica
I define a job with crontab like this 0 2 * * * dbadmin . /home/dbadmin/back.sh it is not root I want to run this .sh file with dbadmin user. but when I checked it is not working. in the log it gives this: Feb 22 21:16:01 localhost crond[14634]: (*system*)...

SMTP(500 Access Denied) Error but i can send mail to gmail or hotmail

linux,email,smtp,centos,exim
I can successfully send email to Gmail or Hotmail accounts but cannot send email like [email protected] mail adresses. I use exim on CentOs server. When i send the email I get this error: SMTP error from remote mail server after MAIL FROM:<[email protected]> SIZE=5598: host example.com [XX.XXX.X.63]: 550 Access denied -...

Running PHP file using command line as background process

php,command-line,centos
I have centos VPS hosting and installed WHM/cPanel . I want to run a php script using command line for unlimited time. My script is look like: <?php set_time_limit(0); while(true) { //code to send me email sleep(600); } ?> I know that this script should be run for unlimited time....

CentOS on Virtualbox, have to use ifdown/ifup after startup

networking,centos,virtualbox
I installed CentOS 7 on a virtual machine, using Virtualbox. I added a host-only interface to the machine before installing the OS, so I can access it from my host environment. In installed net-tools using yum. Everything works fine, except that I have to run the following commands everytime I...

__git_ps1 shows wrong branch

git,shell,centos,ps1
I'm getting an issue where the __git_ps1 script returns the wrong branch. First, I'll check my branches: [email protected] ssalisbury (master)$ git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/master Then I'll create and checkout a new branch, and the __git_ps1 script will still show that I'm on my original branch:...

Running a Docker container that accept traffic from the host

apache,centos,docker,dockerfile
I have the following config: Dockerfile FROM centos MAINTAINER Eduar Tua <[email protected]> RUN yum -y update && yum clean all RUN yum -y install httpd && yum clean all RUN echo "Apache works" >> /var/www/html/index.html EXPOSE 80 ADD run-apache.sh /run-apache.sh RUN chmod -v +x /run-apache.sh CMD ["/run-apache.sh"] The run-apache.sh script:...

IP Messenger for CentOS 7

centos,install,messenger
I'm Using CentOS 7 and trying to install IP messenger in it but not able to install it. Can anyone help me in installing any IP messenger. Any kind of help would be appreciated. Thanks.

ncftpget on amazon ec2 not working (centos)

linux,amazon-web-services,amazon-ec2,amazon-s3,centos
I have set up an Amazon EC2 instance running CentOS 6. I've installed ncftp and I intend to use CRON to automatically pull backups from a private NAS drive overnight for backup. I have also mounted a s3 bucket using s3fs which I'm using as the target directory. When I...

Ocamlfind command not found

centos,make,ocaml,opam,ocamlfind
I'm running into an issue installing a package that's reliant on ocamlfind but I'm getting an ocamlfind: command not found error when making. I have installed ocamlfind with the ocaml package manager and have tried reinstalling using "opam reinstall ocamlfind". I have also tried the 'eval opam config env' command...

Error while installing Odoo

centos,openerp,odoo-8
Finished Dependency Resolution Error Package: odoo-8.0_20150617-1.noarch (odoo-nightly) Requires: python(abi) = 2.7 Installed: python-2.6.6-52.el6.x86_64 (@base) python(abi) = 2.6 Available: python-2.6.6-51.el6.x86_64 (test) python(abi) = 2.6 trying using --skip-broken to work around the problem trying running: rpm -Va --nofiles --nodigest Steps Which I Followed installed the pstgresql 9.4.4 updated the python 2.6 to...

Java 8 , JCE Unlimited Strength Policy and SSL Handshake over TLS

java,ssl,jvm,centos,java-8
With Java 8, server which only supports TLSv1, it fails to make secure socket connection from cent OS Version java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode) Source import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader;...

Installing vnstat on CentOS 6 shows “No package vnstat available”

centos,bandwidth
I'm trying to install vnstat on CentOS 6. I used the command found in the docs 'yum install vnstat' but it shows the below: [[email protected] ~]# yum install vnstat Loaded plugins: fastestmirror Setting up Install Process Determining fastest mirrors * base: mirror.its.dal.ca * extras: mirror.its.dal.ca * updates: mirror.its.dal.ca base |...

Nginx redirect sending localhost instead of the server_name ip adress

nginx,centos
I'm getting a problem with my nginx configuration running on CentOS 7. I'm trying to send the http request on port 80 to a ssl port on 443 the two servers a set up like below: upstream backend { server 192.168.1.79:8080; } server { listen 80; #listen [::]:80; server_name TOTO02;...

Why is SED echoing rather than editing: sed '/^;text1/!b;:a;n;//ba;i\text2' [duplicate]

string,bash,sed,centos,centos7
This question already has an answer here: How do I use a new-line replacement in a BSD sed? 3 answers sed '/^;date.timezone =/!b;:a;n;//ba;i\date.timezone = Europe/London' /etc/php.ini You can probably guess Im creating a script for setting up LAMP servers. In the above example the text is not replaced but...

Apache HTTPD Redirect for mobile devices.

php,apache,mobile,centos,weblogic
Right, so i've a number of sites, and I'm trying to implement a redirect to the mobile version of the site, should the device accessing the desktop site be mobile. i've done this in PHP in the past, and in .js, but this site is giving me issues. RewriteEngine on...

SVN where is the path of files

svn,ssh,centos
I created a svn repository on centos 6.6 My repository <Location /repository> DAV svn SVNParentPath /var/svn AuthType Basic AuthName "Authorization Realm" AuthUserFile /etc/svn-auth-users Require valid-user </Location> I'm able tu use all the funcionts but i cant see for example the page test.php in my centos server i tried to locate...

FreeIPA no host replication

linux,security,ldap,centos,ipa
I have problem with replication of hosts enrolled to FreeIPA between my IPA server and replica (both Centos 6.6 ipa-server-3.0.0). If the host is enrolled to replica I can't see it on Master WEB UI. Although user replication works and the host seem to be in both DNS records (on...

How can I use GoogleMock in jenkins?

c++,gcc,jenkins,centos,googlemock
I installed Jenkins on a CentOS vm. Now I want to run unittests (google test) with mocks (google mock). I tried installing the frameworks like described here. (On my lubuntu machine everything runs without a problem using these steps) When I try to build: g++ -O2 -pthread -Werror -Wall -o...

Why CentOS lost its network interface?

centos,centos7
I have a CentOS 7 VPS which I had multiple sites on its Apache, and these days I faced a strange problem, CentOS lost its interface many times a day! and I should restart the interface to recover this situation! I've take a snapshot from Web console interface of my...

Restrict IO usage using cgroups [closed]

linux,performance,io,centos,cgroups
I am trying to restrict Io usage on my server using cgroups. Here is my partition table info: major minor #blocks name 8 0 10485760 sda 8 1 9437184 sda1 8 2 1047552 sda2 Here is my Filesystem structure: Filesystem Size Used Avail Use% Mounted on /dev/sda1 8.9G 8.4G 37M...

Bash script to find && mkdir

linux,bash,centos
Scenario I'm switching IMAP client on a mail server for several thousands domains with following structure : Mail folder location: /home/mail/domains (just an example) Maildir for domain1.com contains following folders: (again just an example) .Sent.2002.May .Sent.2002.June .Personal.Home.Jack Maildir for domain2.com contains .Sent.2008.June .Emails.Test.test2 Maildir for domain3.com contains .Sent.2012.Files .Archive.2014.May Problem:...

How to resolve dependencies while installing application on linux (CentOS 7.1)

linux,centos,dependencies
When I tried install deluge on my CentOS 7.1 I was facing dependecy problems due to some el6 which are not meant for CentOS 7.1. So, I found this page: https://gist.github.com/dasgoll/111f6f3364e2ab97bc08 His instructions: Centos 7.1 yum -y install wget wget hxxp://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm rpm -ivh nux-dextop-release-0-5.el7.nux.noarch.rpm yum -y install deluge-web systemctl start...

How to extract a complex version number using sed?

regex,bash,sed,centos
I use sed in CentOs to extract version number and it's work fine: echo "var/opt/test/war/test-webapp-4.1.56.war" | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p' But my problem is that i am not able to extract when the version is shown like this: var/opt/test/war/test-webapp-4.1.56-RC1.war I want to extract the 4.1.56-RC1 if it is present. Any ideas...

Puppet Learning VM with Jenkins CI installation

centos,continuous-integration,puppet
I am trying to set up Jenkins CI in Puppet Learning VM ( CentOS 6.5 x86 ), but I cannot make yum to see openjdk 1.7.0 packages, therefore jenkins puppet fails. I have tried adding epel repo - still yum says no package available. I have changed pluginconf to disable...

How to delete files from directory using rm -rf?

linux,centos
I have directory exam with 2 files in it. I need to delete files but permission is denied. Even ![rm -rf][1] command can't delete these files. I logged in as a root user. # rm -rf exam_a # rm -rf exam_b ...

What's the Command to purge/delete all contents in all “public_html” folders?

linux,centos,command,public-html
What's the Command in CentOS to purge/delete all contents in ALL "public_html" folders for all users at once? (I have my web server that I just cloned to make it into a mail server, but I don't want too keep all the public_html files)

Starting multiple tomcat instances in one server with init.d script

centos,tomcat7,multiple-instances,init.d
I'm trying to configure tomcat init.d start script to work with multiple instances (at this time 2 instances) I'm following below sample script to create init.d script #!/bin/bash # # tomcat This shell script takes care of starting and stopping Tomcat # # chkconfig: - 80 20 # ### BEGIN...

Centos - Can't start MySQL

mysql,shell,centos,innodb
I installed ioncube loader, and now i cant start my SQL Server. Error: service mysqld start MySQL Daemon failed to start. Starting mysqld: [FAILED] this is my log 150507 20:01:03 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 150507 20:01:03 InnoDB: Initializing buffer pool, size = 8.0M 150507 20:01:03 InnoDB:...

Docker upgrade issue cent os 6.5

linux,centos,docker
I am trying to upgrade docker on my Cent Os 6.5 virtual machine but facing some problem . when i try to start docker service it didnt start and its status is stopped. [[email protected] /]# sudo service docker status docker is stopped I tried installing docker using below command [[email protected]

Bash scripts - is installing in this way good practice?

linux,bash,centos,yum
In my bash script I have the following lines installing various Linux packages on Centos 6.5 - two questions: is it good practice to do it this way? OR is there a better way maybe using rpms and how would I go about doing that? http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm yum -y install update...

PHP Syntax Error Appearing after moving Servers [duplicate]

php,apache,centos
This question already has an answer here: PHP 5.3.10 vs PHP 5.5.3 syntax error unexpected '[' 3 answers This syntax error has occurred ever since I've moved over to Apache 2 CentOS. [Sat May 02 17:34:46 2015] [error] [client *] PHP Parse error: syntax error, unexpected '[' in /var/www/html/index.php...

How to make this webserver only accessible to your machine and server1.example.com?

linux,web-services,centos
I set up a default configuration webserver. And now I can't make this webserver accessible only to my machine and server1.example.com. # chkconfig httpd on # service httpd start echo “This is a test.? > /var/www/html/index.html # iptables -I INPUT -m state –state NEW -m tcp port 80 -j ACCEPT...

plesk when upgrading php, will this break everything?

php,centos,server,vps,plesk
I'm running a VPS with centOS, plesk 12 and PHP5.3. I'm looking to upgrade to a more recent version of php but without taking down all my sites running on that server. I've tried through the plesk GUI and got to this point which is ambiguous to what it will...

Running two linux commands via PHP, don't wait for first to end before executing second

php,linux,bash,centos,centos6
This is pretty weird, and I searched and tried everything, but I think I'm just making a dumb syntax error here. I'm trying to run a stress test on the CPU , then immediately limit it's cpu usage to 30% , all this via PHP. The test is also run...

Unable to install XML package in R on CENTOS

r,centos
When I try to install xml package in R on CENTOS i recieve such warning: > install.packages("XML") Installing package into ‘/opt/wpusers/r-mkosinski/R/x86_64-redhat-linux-gnu-library/3.1’ (as ‘lib’ is unspecified) trying URL 'http://cran.rstudio.com/src/contrib/XML_3.98-1.1.tar.gz' Content type 'application/x-gzip' length 1582216 bytes (1.5 Mb) opened URL ================================================== downloaded 1.5 Mb * installing *source* package ‘XML’ ... ** package...

Python2.7 - pip install pymssql fails on CentOS 6.3

python,centos,pip,freetds,pymssql
I am trying to install pymssql for Python on a CentOS machine however it keeps failing on me. I have already installed the following: freetds-devel python-devel Which seems to be the fix I keep coming across in searches, however I have already installed both of these and I am still...

Rvm install ruby 2.2.0 on centos

ruby,centos,rvm
I get strange error while installing ruby 2.2.0 by rvm at centos 5. Here is the log of installation: [[email protected] asiniy]$ rvm list ruby-2.1.0 [ i686 ] =* ruby-2.1.1 [ i686 ] I try to remove cache of previous installation: [[email protected] asiniy]$ rvm remove 2.2.0 ruby-2.2.0 - #removing src/ruby-2.2.0.. Reset...

Puppet/Ruby: How to use a ruby variable in a bash line?

ruby,bash,centos,puppet
I have a Nagios NRPE module in my Puppet environment. In the nrpe.cfg template I've configured some if statements in order to set specific checks to specific hosts. Example: <% if @hostname =~ /rs\d+/ -%> command[check_smtp]=/usr/lib64/nagios/plugins/check_smtp -H rs01.company.com -p 25 -e rs01.company.com <% end -%> Meaning: If hostname starts with...

Solr 5.0.0 is not starting properly in CentOS

solr,lucene,centos,solrcloud
When I running command bin/solr start -e cloud it is not asking me to collection name and other information like no of replicas and configuration settings. I got following output Welcome to the SolrCloud example! This interactive session will help you launch a SolrCloud cluster on your local workstation. To...

How to print a result from multiple root elements in XML using Perl

regex,xml,perl,xml-parsing,centos
I'm starting out with Perl and doing all the bad things you can with the language. This program is using XML::Simple and Regular Expressions which the internet says do not do unless you hate yourself. Ok, the plan is to read an XML file from a website and read off...

How to prevent parallel installation of multiple version of an RPM?

linux,centos,rpm,rhel,rpmbuild
I'm creating an RPM file (with rpmbuild). Currently it is possible to install several versions of the RPM in parallel (apparently RPM doesn't prevent this), but this causes problems because my %pre and %post scripts create and delete some files, so multiple parallel installations will conflict with each other. Is...

Can't install PHP Package on CentOS

php,linux,centos,yum
I am having trouble re-installing PHP via yum on my server hosted by digital ocean. I had PHP 5.4 installed but wanted 5.6. I added/enabled the remi repo's, ran yum -y remove php* and then tried to re-install php. When I run yum -y install php I get the following:...

Run PHP script in crontab only works when exporting to a file

php,linux,centos,crontab
On CentOS release 6.5 (Final): I know that usually I just need to use the following command in crontab to run a php script. 0 * * * * /usr/local/bin/php absolute_path_file_to_the_script.php But, recently, it stopped working. The only work around is to use the following command 0 * * *...

How to add 100MB of swap space as a logical volume in CentOS?

linux,centos
I need to add 100MB of swap space to my machine. I was trying to use a logical volume. # lvcreate –name lv_swap2 –size 100M vg # mkswap /dev/vg/lv_swap2 # swapon /dev/vg/lv_swap2 # vi /etc/fstab /dev/vg/lv_swap2 swap defaults 0 0 It doesn't work... Need help!...

EC2 root volume expansion for CentOS7

linux,amazon-web-services,amazon-ec2,centos,centos7
My EC2 is running with CentOS 7 HVM community image which comes default as xfs file system, and I had a root volume with 10GB which I extended to 15GB after detaching > creating snap > reattaching to /dev/sda1 but I noticed that I did not had to run any...

cron service is running but not executing cron jobs in centos

tomcat,cron,centos,logrotate,catalina
I have created a policy to rotate catalina.out of tomcat, my cron service is running and I can even check the log to verify the jobs but I am not getting the desired output. Here is my code /etc/logrotate.d/tomcat /opt/tomcat7/logs/catalina.out { copytruncate rotate 7 compress missingok size 1k } /etc/crontab...

can not ping as normal user in Docker centos image

centos,docker
My Dockerfile FROM centos RUN useradd me CMD su -c "ping localhost" me My test commands: $ docker build -t test . $ docker run --rm -it test ping: icmp open socket: Operation not permitted $ docker run --rm -it test /bin/bash [[email protected] /]# ping localhost PING localhost (127.0.0.1) 56(84)...

PhpStorm 8.0.3 crashing itself and Windows Samba share

windows-7,centos,phpstorm,samba,windows-explorer
I access the code on my CentOS VM through a Samba share on my Windows machine. I have been using PhpStorm for a while now, however this morning I have been unable to use PhpStorm to access the Samba share. When PhpStorm loads it shows a blank screen (no project...

createrepo using --split option for a multi CD distribution

linux,centos,install
I am trying to create a customized CentOS multi CD installation. Our current distribution just grew past the size of a CD. Sure, you can just burn it on a DVD. Well, we have customers with old machines that do not support DVDs so I have to create a distribution...

CLASSPATH variables not showing up for root user in CentOS 6.6

centos,centos6
I am running CentOS 6.6 on VmWare Player. I have added path export CLASSPATH=$CLASSPATH:<path/to/jars> of the required jar files to .bash_profile which resides in my home folder. Also on executing the following command: [email protected]$ echo $CLASSPATH It displays the classpath as expected. But, there are some tasks that I need...

Compile and install php5.4, make: *** [libphp5.la] Error 1

php,centos,redhat,lamp,build-error
I am trying to build PHP with the following build configuration: ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr/include/libxml2/libxml --enable-xml --enable-sockets --with-apxs2=/usr/local/httpd/bin/apxs --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2=/usr/bin/bzip2 --enable-maintainer-zts and...

How to install extencion in magento on ssh

magento,ssh,centos
How do I install a Connect 2.0 extension to my local development box without using the /downloader UI? How can I script this in a deployment routine?

How To Restore a Missing Redis Service

linux,redis,centos
I installed an older version of Redis on a CentOS server. I tried to remove that old version and update it to latest version, but it seems that the redis service is gone and the new version installation doesn't reproduce it. Is there any way I can uninstall the Redis...

virtualhost configuration on centos6 vps for a symfony2 project failing with 500 error

apache,symfony2,centos,virtualhost,suphp
I have a VPS running Centos6 (although if my luck so far carries on I might throw it out of the window!). I am trying to get a small symfony2 project up and running but Im bashing against this error message in the server logs. There are other non-framework based...

autoexpect on docker centos6.6 container cannot work

centos,docker,expect,autoexpect
Docker container pure image: centos6.6 after bash, I install these: yum -y install tar zip unzip expect glibc.i686 Package expect-5.44.1.15-5.el6_4.x86_64 already installed and latest version and run autoexpect, I always get these error: [[email protected] bin]# autoexpect autoexpect started, file is script.exp no such variable (read trace on "env(SHELL)") invoked from...

sqlite3 cannot open database file, running Centos, flask uwsgi nginx

nginx,sqlite3,flask,centos,uwsgi
I have a fairly simple flask app which runs fine on my local machine. The app uses sqlite3. I am trying to deploy to a CentOS machine running nginx and uwsgi. The app starts but when I try to access the site through chrome, it raises an exception: sqlite3.OperationalError: unable...

.htaccess not redirecting web site to https

.htaccess,ssl,centos
I am running Apache/2.2.15 on Centos 6.6 and am using a free certificate from StartCom. My home page file is /var/www/index.php so I create a file /var/www/.htaccess with the following content, as suggested here. RewriteEngine On # This will enable the Rewrite capabilities RewriteCond %{HTTPS} !=on # This checks to...

AWS Block Devices name doesn't match with CentOS SoftLink

amazon-web-services,amazon-ec2,centos,cloud,block-device
On AWS EC2 Block Device is identified as /dev/sda, /dev/sdf and /dev/sdg, but inside EC2 CentOS instance when I do ll /dev/sd* it gives following: lrwxrwxrwx. 1 root root 4 Feb 17 03:10 /dev/sda -> xvde lrwxrwxrwx. 1 root root 4 Feb 17 03:10 /dev/sdj -> xvdj lrwxrwxrwx. 1 root...

I can't convert with ImageMagick

php,centos,imagemagick
I'm using ImageMagick to convert a PDF file. I use this PHP snippet: $cadena = "/usr/local/bin/convert -density 100 -colorspace rgb ".$name_path." ".$images_path."/convert.png"; shell_exec($cadena); where $name_path is the PDF file directory and $images_path is the images directory. This code in console (CentOS) works perfectly. But when I try to use shell_exec()...

ffmpeg convert any file to any file

linux,ffmpeg,centos,command
I Want simple command to convert any supported file to any file with little possible video compression. for example avi to mp4 mp4 to 3gp . .etc.. I tried below code ffmpeg -i infile.flv outfile.3gp It works for some but for some other like flv to 3gp conversion it throws...

Google compute engine boot fails after hw upgrade to hashwell

centos,google-compute-engine
I have a f1-micro instance running on google compute engine running centos. Some time ago i got a mail stating that the zone i am using (us-central1-b) is going through a hardware upgrade to new hashwell servers, and all instances need to be restarted. So, i did restart. I shut...

How to Monitor files that are present in another server

linux,centos,monitor
Can anyone please let me know if there are any ways that we can monitor a directory in centOS (linux) which is present in different server and when a new file arrives in that directory I need to copy that file to my server.

git push error: could not read Username for 'https://github.com': Permission denied

linux,git,github,ssh,centos
I'm on CentOS 7 and trying to push to github. First I was using ssh, but my system seems to have some weird bug where my ssh keys keep disappearing (I know that's unbelievable, but I have no other explanation.) Instead, I've been trying to use https, but I'm unable...

Apache (PHP) & Mysql - Ideal 2 Server Setup

php,mysql,apache,centos,mariadb
My client currently has only one server with both MySql and Apache running on it, and at busy times of the year they're occasionally seeing Apache fall over as it has so many connections. They run two applications; their busy public ecommerce PHP based website and their (busy during working...

How can I read iso-8859-1 file

linux,centos,command-line-interface
I try to read File.java file with iso-8859-1 encoding . I executed command like this iconv -f ISO-8859-1 FileSorter.java -t ASCII//TRANSLIT but I still get some wrong characters after converting: /** * Yoio iaoia auiieiyao ni?oe?iaeo nienea oaeeia * @param fileList iaioni?oe?iaaiiue nienie oaeeia * @return ioni?oe?iaaiiue nienie oaeeia */...

rpmbuild no such file or directory

centos,redhat,rpmbuild,rpm-spec
I'm just learning making rpm packages for some custom builds of software that gets compiled from source (some legacy stuff needs this, so I'm trying to learn, as some packages can't use the latest versions), but hitting an error (I'm doing this in Vagrant, and also as root, but typically...