Posts tagged Linux

Linux Logo

Linux – CentOS6 – Git – fatal – Where do you want to fetch from today?

0

If you are using GIT as your version control and you attempt to do a `git pull` and get a “fatal: Where do you want to fetch from today?” message, you need to do either of the following:

# Specify the remote repo
mkdir repo
cd repo && git init
git pull git@github.com:user/repo.git

# Or
# Clone the repo
mkdir repo
cd repo && git clone git pull git@github.com:user/repo.git .
git pull
Linux Logo

Linux – CentOS6 – httpd – mod_file_cache – mod_mem_cache – mod_imagemap – Cannot Load into Server – Cannot Open Shared Object

0

If you are upgrading from CentOS5 to CentOS6 and attempt to start httpd, you may come across a message similar to: “Starting httpd: httpd: Syntax error on line 196 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_file_cache.so into server: /etc/httpd/modules/mod_file_cache.so: cannot open shared object file: No such file or directory”. Apparently the removal of some apache mods was an upstream decision which CentOS passed through to us. You can find more information here.

The quick fix is to remove these references from your httpd.conf file, however if you depend on these modules being available, you will have to download and compile manually.

Linux Logo

Linux – CentOS – SELinux – Cannot Start httpd – Permission to httpd.conf Denied

0

If you are attempting to start apache (httpd) and get permission denied errors, chances are your SELinux is enabled, and not configured to allow httpd connections. Use the following commands to get your httpd working.

# To view current selinux settings related to httpd:
getsebool -a | fgrep -i httpd

# To "pinhole" SELinux to allow httpd to start correctly:
setsebool -P httpd_can_network_connect 1
setsebool -P httpd_enable_homedirs 1

Linux – Ruby – Capistrano – GIT – No Such File or Directory – Errno::ENOENT

0

If you are running capistrano to execute commands on another server and get a message that looks like:

No such file or directory - /usr/local/git/bin/git ls-remote git@github.com:user/repo.git master (Errno::ENOENT)

Be sure the user whom you are logging in as through capistrano has access to `git`. To test whether the user has access, ssh as the user and type `git`, if you get a bash error, then set the path in the user’s ~/.bash_profile. Otherwise you should see a list of git options.

Linux – CentOS6 – Ruby – It seems your ruby installation is missing psych

0

If you are compiling ruby from source on a CentOS box, you may come across a “it seems your ruby installation is missing psych” message. To fix this issue you will also need to compile libyaml. If you installed libyaml to a custom directory you will need to let ruby know during configuration:

 ./configure --prefix=/usr/local/_custom/app/ruby --with-opt-dir=/usr/local/_custom/app/libyaml/

Now, after you have done `make && make install` you should be able to run ruby without the error message.

Linux – CentOS6 – Adding or Updating Custom Gateway

0

Just started working with CentOS6 and came across an issue where I found it difficult to add a gateway for my eth0 interface. The netinstall I conducted didn’t appear to have an entry area for it (or I may have missed it). If you need to add or update your gateway do the following:

vi /etc/sysconfig/network
NETWORKING=yes
GATEWAY=192.168.0.254
/etc/init.d/network restart

Now your gateway should be working as expected.

Linux – CentOS – 6 – Installing Percona MySQL

0

If you are looking to install Percona MySQL on a CentOS 6 server, you will need to install the ‘Percona-Server-shared-compat.x86_64′ package, if you don’t, you will end up with errors when installing the ‘Percona-Server-server-55.x86_64′ package.

Linux – Nginx – Config – Concate $var to string

0

Yesterday I ran into a situation where I had to concatenate a variable to a string within an NGinx config file. Seemed easy enough, but found it to be quite troublesome. At first I thought there may have been a special concat character, like the ‘.’ in PHP, but there isn’t, rather the concatenation construct for NGinx is similar to BASH. Check out the following example:

set $foo = 'foo';

set $foobar "${foo}_bar"; #Concatenating $foo to _bar

Linux – CentOS – No acceptable C compiler found in $PATH

2

If you attempt to compile an application from source and run into a ‘no acceptable C compiler found in $PATH’ on a CentOS system, just run:

yum install gcc

Linux – ACK – Basic Usage

0

There are times where you may need to search for code snippets throughout your codebase, for example if you are planning on deprecating a function, or change the argument list etc. I used to use ‘fgrep’, but a friend locked me onto ‘ack’, which I find much more useful out of the two. You can find more information at ack’s website @ http://betterthangrep.com/.

By default ack searches are recursive, so it’s one less flag you have to pass (vs fgrep -r), not that big of a deal, but still nice. Also ack output is easier to read and can be configured to your preferences.

Basic Search

ack 'string'

Case Insensitive Search

ack -i 'string'

Exclude Dir

There may be times where you want to exclude a dir from the search, so you don’t end up a ton of permission errors for example.

ack --ignore-dir=dir 'string'
Go to Top