issues with installing, No config files OpenVPN 2.3.2-4.el7.x86_64 on Centos 7

Jordan Street asked:

Having some issues with OpenVPN 2.3.2-4.el7.x86_64 on Centos 7 (it’s a VPS with digital ocean).

Basically I am trying to install and configure OpenVPN to use as a VPN server. However it seems I am missing the configuration files this is long winded so if you think you can help details are below and thanks in advance.

Here is what I have done thus far:

yum install epel-relase
yum install openvpn
yum install openssl openssl-devel
yum install pam-devel
yum install lzo-devel

Above commands worked without error and so reading the howto I attempted to start editing the config files so I could learn how OpenVPN works except they don’t exist. I see this by running the commands

cp /usr/share/doc/openvpn-*/sample-config-files/server.conf /etc/openvpn

this throws an error about directories/files that don’t exist

Running the below command

cd /usr/share/doc/packages/openvpn and cd /usr/share/doc/openvpn

I get the following error or some variation of this:

bash: /usr/share/doc/packages/openvpn: No such file or directory

I’m trying to edit the server.conf (with vi/vim) and other related files(that according to the docs and the howto’s should be there) gives me a blank file it’s almost like I’m not getting the included sample config’s

The following google-fu hasn’t helped (I did the same searches directly on server fault)

  • Openvpn no config files
  • how to install openvpn centos 7
  • openvpn rpm install vs yum install

I have read some of the manpages for OpenVPN and while useful with examples of config files and options doesn’t really specify install issues or directory structures (at least that I can see thus far anyway)

links here:

  • openvpn.net/index.php/open-source/documentation/howto.html#config
  • community.openvpn.net/openvpn/wiki/Openvpn23ManPage

and have read these similar server fault questions here:

  • serverfault.com/questions/634676/centos-7-and-openvpn-how-make-them-friends
  • serverfault.com/questions/345070/openvpn-incomplete-rpm

I am doubtful that the openvpn doc’s are incomplete or wrong but I’m at a loss as to what I’m doing wrong here.

Also finally I did try installing manually via RPM (on a fresh droplet)…but doesn’t get me very far
running these commands:

wget http://swupdate.openvpn.org/community/releases/openvpn-2.3.2.tar.gz
sudo yum install openssl-devel lzo-devel pam-devel
rpmbuild -tb openvpn-2.3.2.tar.gz
sudo rpm -ivh rpmbuild/RPMS/x86_64/openvpn-2.3.2-1.x86_64.rpm

The final command doesn’t work. Basically gives me an error that the folder rpmbuild cannot be found

Sorry for the long winded question…but the TL;DR is that I install openvpn but don’t have any config files to work with.

Do I need to wget these files manually to make it work?

Cheers in advance guys and again sorry for the long winded post 🙂

My answer:


Did you try actually looking in the directories to see what was in there, e.g. with ls? It looks like you were randomly pasting commands you copied from the Internet without understanding what they do. And it’s very concerning that you don’t seem to fully understand what cd does or how to navigate a directory structure; this is something that you really should learn as soon as possible.

Anyway, I found the sample config files in /usr/share/doc/openvpn-2.3.2/sample/sample-config-files, that is, under a further subdirectory. So I suspect you simply never actually looked to see what was there.

Copying the server.conf from the correct directory to /etc/openvpn appears to work fine. After editing your configuration file to taste, completing the setup is simply systemctl enable openvpn@server and systemctl start openvpn@server.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.