Questions tagged [centos]
CentOS (Community Enterprise Operating System) is based on the Red Hat Enterprise Linux operating system. QUESTIONS MUST BE ABOUT RUNNING PROGRAMS UNDER CENTOS. Questions about server administration may be asked on https://serverfault.com
centos
12,463
questions
378
votes
12
answers
1.0m
views
Open firewall port on CentOS 7 [closed]
I am using CentOS 7 and I have to ensure that ports 2888 and 3888 are open.
I read this article but this did not work because on CentOS 7 OS there is no iptables save command.
Someone told me that ...
285
votes
7
answers
72k
views
How to ignore xargs commands if stdin input is empty?
Consider this command:
ls /mydir/*.txt | xargs chown root
The intention is to change owners of all text files in mydir to root
The issue is that if there are no .txt files in mydir then xargs thows ...
275
votes
6
answers
245k
views
How to use a different version of python during NPM install?
I have terminal access to a VPS running centos 5.9 and default python 2.4.3 installed. I also installed python 2.7.3 via these commands: (I used make altinstall instead of make install)
wget http://...
270
votes
2
answers
682k
views
How to grep a string in a directory and all its subdirectories? [duplicate]
How to grep a string or a text in a directory and all its subdirectories'files in LINUX ??
266
votes
15
answers
277k
views
How to install latest version of git on CentOS 8.x/7.x/6.x
I used the usual:
yum install git
It did not install the latest version of git on my CentOS 6. How can I update to the latest version of git for CentOS 6? The solution can be applicable to newer ...
255
votes
10
answers
213k
views
pip install - locale.Error: unsupported locale setting
Full stacktrace:
➜ ~ pip install virtualenv
Traceback (most recent call last):
File "/usr/bin/pip", line 11, in <module>
sys.exit(main())
File "/usr/lib/python3.4/site-packages/pip/...
253
votes
3
answers
226k
views
nginx missing sites-available directory
I installed Nginx on Centos 6 and I am trying to set up virtual hosts. The problem I am having is that I can't seem to find the /etc/nginx/sites-available directory.
Is there something I need to do ...
230
votes
8
answers
321k
views
How do I find which rpm package supplies a file I'm looking for?
As an example, I am looking for a mod_files.sh file which presumably would come with the php-devel package. I guessed that yum would install the mod_files.sh file with the php-devel x86_64 5.1.6-23.2....
229
votes
12
answers
298k
views
Nginx 403 forbidden for all files
I have nginx installed with PHP-FPM on a CentOS 5 box, but am struggling to get it to serve any of my files - whether PHP or not.
Nginx is running as www-data:www-data, and the default "Welcome to ...
200
votes
16
answers
160k
views
Automatically start forever (node) on system restart
I am using node's forever module to keep my node server running. Forever however terminates when there is a system restart. Is there any way I can automatically start the node server (with forever) ...
190
votes
21
answers
280k
views
VirtualBox: mount.vboxsf: mounting failed with the error: No such device [closed]
I'm using VirtualBox with OS X as host and CentOS on the guest VM.
In OS X I created folder myfolder, added it as shared folder to the VM, turned on the VM, in CentOS created folder /home/user/...
189
votes
12
answers
534k
views
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
I tried to restart my Apache server on CentOS 5.0 and got this message:
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Here is the /...
186
votes
9
answers
389k
views
CentOS 64 bit bad ELF interpreter
I have just installed CentOS 6 64bit version, I'm trying to install a 32-bit application on a 64-bit machine and got this error:
/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
...
180
votes
17
answers
255k
views
ffprobe or avprobe not found. Please install one
I want to add tags to mp3 converted by youtube-dl & ffmpeg:
youtube-dl -o
'/Output/qpgTC9MDx1o.mp3' qpgTC9MDx1o -f bestaudio --extract-audio --metadata-from-title "%(artist)s -
%(title)s&...
161
votes
5
answers
535k
views
Where is the php.ini file on a Linux/CentOS PC? [duplicate]
I can't find PHP.ini location on my server. I've checked all Stack Overflow answers but I can't find my php.ini location.
I have Linux, Cent OS, zPanel. Last version of PHP.
My computer: Linux Mint ...
159
votes
24
answers
505k
views
ImportError: No module named psycopg2 [duplicate]
In installation process of OpenERP 6, I want to generate a config file with these commands:
cd /home/openerp/openerp-server/bin/
./openerp-server.py -s --stop-after-init -c /home/openerp/openerp-...
154
votes
9
answers
423k
views
How can I use iptables on centos 7? [closed]
I installed CentOS 7 with minimal configuration (os + dev tools). I am trying to open 80 port for httpd service, but something wrong with my iptables service ... what's wrong with it? What am I doing ...
135
votes
8
answers
465k
views
Two versions of python on linux. how to make 2.7 the default
I've got two versions of python on my linuxbox:
$python
Python 2.6.6 (r266:84292, Jul 10 2013, 22:48:45)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "...
130
votes
12
answers
349k
views
javac : command not found
I have installed java in my CentOS release 5.5 machine using the command yum install java. But I am unable to compile a class using javac.
Do I need to install any other package?
I have tried to ...
127
votes
9
answers
484k
views
index.php not loading by default
I have just installed CentOS, Apache and PHP. When I visit my site http://example.com/myapp/, it says "forbidden". By default it's not loading the index.php file.
When I visit http://example.com/...
122
votes
14
answers
263k
views
bash: mkvirtualenv: command not found
After following the instructions on Doug Hellman's virtualenvwrapper post, I still could not fire up a test environment.
[mpenning@tsunami ~]$ mkvirtualenv test
-bash: mkvirtualenv: command not found
[...
120
votes
20
answers
140k
views
EC2 Can't resize volume after increasing size
I have followed the steps for resizing an EC2 volume
Stopped the instance
Took a snapshot of the current volume
Created a new volume out of the previous snapshot with a bigger size in the same region
...
117
votes
19
answers
172k
views
Unable to install pyodbc on Linux
I am running Linux (2.6.18-164.15.1.el5.centos.plus) and trying to install pyodbc. I am doing pip install pyodbc and get a very long list of errors, which end in
error: command 'gcc' failed with ...
113
votes
8
answers
181k
views
Check if directory mounted with bash
I am using
mount -o bind /some/directory/here /foo/bar
I want to check /foo/bar though with a bash script, and see if its been mounted? If not, then call the above mount command, else do something ...
112
votes
5
answers
103k
views
Vagrant's port forwarding not working [closed]
I'm running into a small problem at the end of the Getting Started guide for vagrant. I'm working on a CentOS basebox that has Apache2 running (provisioning via Puppet). I've set up port forwarding ...
111
votes
27
answers
346k
views
Apache is downloading php files instead of displaying them
OS and server information:
CentOS 6.4 (Final)
Apache 2.2.15
PHP 5.5.1
I previously had php 5.3.x installed but decided to upgrade. I first uninstalled the php 5.3.x and then installed php 5.5.1 but ...
109
votes
6
answers
95k
views
cannot find autoconf. please check your autoconf installation Xampp in CentOS
Getting another error when configuring memcahed with php in XAMPP in CentOS
# /opt/lampp/bin/phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend ...
109
votes
7
answers
213k
views
How to get a list of programs running with nohup
I am accessing a server running CentOS (linux distribution) with an SSH connection.
Since I can't always stay logged in, I use "nohup [command] &" to run my programs.
I couldn't find how to get a ...
107
votes
6
answers
158k
views
How can I view the complete httpd configuration?
I'm trying to figure out what is the full complete configuration of an httpd setup.
All the configurations files are scattered in different files (/etc/httpd/conf.d, httpd.conf, various mod configs)...
106
votes
11
answers
224k
views
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
I am trying to download java using yum on centOs which I specified in a Dockerfile.
After pulling centOs image the run crashed and threw this error!?
also to mention that my server instance is AWS EC2!...
103
votes
12
answers
277k
views
How to install Java SDK on CentOS?
I have CentOS 5, but I don't know the steps to install Java SDK on Linux.
Where to download the RPM file and what can I do next to fully install that?
Then I need to install Tomcat.
Or is there any ...
102
votes
35
answers
561k
views
ssh : Permission denied (publickey,gssapi-with-mic)
i'm use centos 5.9.
after installing gitlab by this link ssh not working.
before install gitlab ssh correctly working.
i'm using this server localy and other services such as elastix and apache,mysql ...
99
votes
4
answers
33k
views
Use sudo with .vimrc
I'm using CentOS and created a .vimrc file in my /home directory. I tested it out by creating a txt file and yes, that worked fine. Now, I have my project files in my /srv directory with SELinux ...
98
votes
14
answers
327k
views
How to check all versions of Python installed on OS X and CentOS
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 ...
96
votes
5
answers
29k
views
Difference between $HOME and '~' (tilde)?
I had always thought that $HOME and ~ were exactly the same and thus could
be used interchangeably. Today, when I tried to install pylibmc, a python
binding to memcached, on my shared server the use ...
95
votes
3
answers
241k
views
How do I download a file from the internet to my linux server with Bash [closed]
I recently had to upgrade to a VPS server (HostGator Linux) because I wanted to run a script that was a bit more complicated than the regular PHP db manipulation. I'm trying to install a JDK and ...
93
votes
4
answers
259k
views
how to use python2.7 pip instead of default pip
I just installed python 2.7 and also pip to the 2.7 site package.
When I get the version with:
pip -V
It shows:
pip 1.3.1 from /usr/lib/python2.6/site-packages (python 2.6)
How do I use the 2.7 ...
92
votes
3
answers
241k
views
Centos/Linux setting logrotate to maximum file size for all logs
we use logrotate and it runs daily ... now we have had some situations where logs have grown significantly (read: gigbaytes) and killing our server. So now we would like to set a maximum filesize to ...
88
votes
15
answers
192k
views
Install python 2.6 in CentOS
I have a shell that runs CentOS.
For a project I'm doing, I need python 2.5+, but centOS is pretty dependent on 2.4.
From what I've read, a number of things will break if you upgrade to 2.5.
I want ...
82
votes
4
answers
347k
views
No space left on device [closed]
I am getting the error "No space left on device" when i tried to scp some files to a centos machine,
tried to check:
[root@...]# df -h
Filesystem Size Used Avail Use% Mounted on
/...
80
votes
5
answers
197k
views
Run bash script as daemon
I have a script, which runs my PHP script each X times:
#!/bin/bash
while true; do
/usr/bin/php -f ./my-script.php
echo "Waiting..."
sleep 3
done
How can I start it as daemon?
76
votes
1
answer
176k
views
How to install crontab on Centos
I am familiar to setup the cron scheduler using crontab -e command on my centos. But today I found one of my centos servers doesn't have this command
I have tried to install this using yum install ...
75
votes
13
answers
402k
views
Installing PHP Zip Extension in CentOS
I'm attempting to install the PHP Zip extension in CentOS.
My server does not have external internet access, so I downloaded it myself from PECL: http://pecl.php.net/package/zip. I chose 1.10.2, the ...
74
votes
5
answers
101k
views
How to install packages in Linux (CentOS) without root user with automatic dependency handling?
Is it possible to use RPM or YUM or any other package manager in Linux, specifically CentOS, to install a package either already downloaded or from repo to a custom location without admin/root access?
...
73
votes
7
answers
204k
views
How to change the MySQL root account password on CentOS 7?
I have installed mySQL on a CentOS 7 VM but I have problems logging in with root.
I tried logging in without password or tried any default ones (like mysql, admin etc) I looked in the my.cnf file and ...
70
votes
2
answers
45k
views
GIT get the commit hash prior to a specific commit
git 1.7.1
git show <hash>:<file> gives me the file based on the commit hash provided
I am trying to figure out how to bet the file of the previous commit before the one who's hash I have....
70
votes
1
answer
38k
views
Docker on CentOS 7.2: kernel:unregister_netdevice: waiting for lo to become free. Usage count = 1
I'm running Docker on CentOS 7, from time to time there's the following message displayed:
Message from syslogd@dev-master at Mar 29 17:23:03 ...
kernel:unregister_netdevice: waiting for lo to ...
69
votes
2
answers
292k
views
How to open port in Linux [closed]
I have installed and web application which is running on port 8080 on RHEL (centOS). I only have command line access to that machine. I have tried to access that application from my windows machine ...
67
votes
17
answers
203k
views
httpd Server not started: (13)Permission denied: make_sock: could not bind to address [::]:88
I am trying to start httpd server on centos 6. It throws following error :
[root@machine ~]# service httpd start
Starting httpd: (13)Permission denied: make_sock: could not bind to address [::]:88
(...
67
votes
5
answers
185k
views
How to display list of running processes Python?
How to display list of running processes Python with full name and active status?
I tried this command: pgrep -lf python