connecting openldap with phpldapadmin - openldap

I have 3 servers meant for openldap, phpldapadmin and client access. i have done phpldapadmin installation and i can access it through server 3 in browser http://example.local/ldapadmin
and in server 1 (openldap) i have open ldap protocol, port 389/tcp and install ldap:
yum install -y openldap openldap-clients openldap-servers
chkconfig slapd on
systemctl enable slapd
systemctl start slapd
but when i try to login it said:
can't contact ldap server (-1) for user
anyone knows how to configure openldap so it can use/manage by phpldapadmin remotely?
what configuration missing?
environment: centos 7
Thank you,
AnD

In order for this to work you have to make some modifications, after you have installed openldap and phplapadmin.
Luckily, you have centos 7 !! Just go follow these links
For Openldap, you must configure your ldap, follow this link
For phpldapadmin, follow this link

First check if openldap is accessible from the machine where phpldapadmin is installed using below command
telnet <ip-of-openldap-machine> 389
If you find port opened check below configuration settings from phpldapadmin config file. You will find config file under /etc/phpldapadmin/config.php
$servers->setValue('server','host','127.0.0.1');
$servers->setValue('server','base',array('dc=example,dc=com'));
$servers->setValue('login','bind_id','cn=admin,dc=example,dc=com');
This should do the work incase of vanilla installation of openldap server.

In /etc/phpldapadmin you will find a config.php file. In this file you specify the servers with the $server variable like this:
$servers->setValue('server','host','name_or_ip_of_your_server');
If the directory is missing you have not installed phpldapadmin correctly, to do that run:
sudo apt-get install phpldapadmin
or
sudo yum install phpldapadmin

Related

Jenkins: This site cannot be reached

I set up a DigitalOcean server running ubuntu 18.04 and am trying to run Jenkins on it. I followed the instructions to the letter in this tutorial:
https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-ubuntu-18-04
which works perfectly until Step 4. When I enter:
http://your_server_ip_or_domain:8080
substituting the DigitalOcean ip for "your_server_ip_or_domain", of course, the browser says "This site cannot be reached". Every step before that worked perfectly. The firewall is open to it.
I also made sure the JRE was installed.
EDIT: I read in another tutorial that Jenkins does not support Java 10 or 11, so I removed Java 11 and installed Java 8, and followed this tutorial:
https://linuxize.com/post/how-to-install-jenkins-on-ubuntu-18-04/
I also installed a web server using the following command:
sudo apt-get install nginx
Same error whether I put the ipaddress in the browser or ipaddress:80 or ipaddress:8080. I can ping the ip from outside the network ok. Any ideas?
I figured it out. Nginx is listening on port 80 so you need to open the firewall to that port as well. Use the following command:
sudo ufw allow 80
Now I can get the default web page for nginx by using ipaddress:80 and jenkins by entering ipaddress:8080

Configure Docker to use a proxy server

I have installed docker on windows , when I try to run hello-world for testing on docker. I get following error
Unable to find image
My computer is using proxy server for communication. I need to configure that server in the docker. I know proxy server address and port. Where I need to update this setting. I tried using https://docs.docker.com/network/proxy/#set-the-environment-variables-manually.
It is not working.
Try setting the proxy. Right click on the docker icon in system tray, go to settings, proxy and add the below settings:
"HTTPS_PROXY=http://<username>:<password>#<host>:<port>"
If you are looking to set a proxy on Linux, see here
The answer of Alexandre Mélard at question Cannot download Docker images behind a proxy works, here is the simplified version:
Find out the systemd script or init.d script path of the docker service by running:service docker status or systemctl status docker, for example in Ubuntu16.04 it's at /lib/systemd/system/docker.service
Edit the script for example sudo vim /lib/systemd/system/docker.service by adding the following in the [Service] section:
Environment="HTTP_PROXY=http://<proxy_host>:<port>"
Environment="HTTPS_PROXY=http://<proxy_host>:<port>"
Environment="NO_PROXY=<no_proxy_host_or_ip>,<e.g.:172.10.10.10>"
Reload and restart the daemon: sudo systemctl daemon-reload && sudo systemctl restart docker or sudo service docker restart
Verify: docker info | grep -i proxy should show something like:
HTTP Proxy: http://10.10.10.10:3128
HTTPS Proxy: http://10.10.10.10:3128
This adds the proxy for docker pull, which is the problem of the question. If for running or building docker a proxy is needed, either configure ~/.docker/config as the official docs explained, or change Dockerfile so there is proxy inside the container.
I had the same problem on a windows server and solved the problem by setting the environment variable HTTP_PROXY on powershell:
[Environment]::SetEnvironmentVariable("HTTP_PROXY", "http://username:password#proxy:port/", [EnvironmentVariableTarget]::Machine)
And then restarting docker:
Restart-Service docker
More information at Microsoft official proxy-configuration guide.
Note: The error returned when pulling image, with version 19.03.5, was connection refused.

Site is down after VM restart Google Cloud Engine

After a restart of my VM instances my site is down. I checked the IP address, but it didn't change. Do you have any ideas about what is wrong and how to fix it?
I run WordPress (Bitnami) on a Debian-based OS. I use Cloudflare CDN. I understand that on stopping a VM it doesn't keep the settings. Can I restore them?
About your last error message
Syntax OK (98)Address already in use: AH00072: make_sock: could not
bind to address 0.0.0.0:80 no listening sockets available, shutting
down AH00015: Unable to open logs /opt/bitnami/apache2/scripts/ctl.sh
: httpd could not be started Monitored apache
I have found similar errors due to Nginx, it could happen if you have it installed and it is creating conflicts. make sure you remove it as follow:
sudo apt-get remove nginx nginx-common
sudo apt-get autoremove #to remove unneeded dependencies
Your environment doesn't loose configuration "settings", but rather the servers that use those configurations will terminate their processes when the VM shuts downs and will need to be restarted.
The problem is likely that you need to restart both your Apache web server (which starts the PHP runtime and proxies HTTP requests) and your MySQL server (which is your database)...
Restart Apache:
sudo service apache2 restart
Restart MySQL:
sudo service mysql restart
OR
sudo /etc/init.d/mysql restart
EDIT: It appears your Bitnami image has a different configuration...
Start All services: sudo /opt/bitnami/ctlscript.sh start
Restart Apache: sudo /opt/bitnami/ctlscript.sh restart apache
Restart MySQL: sudo /opt/bitnami/ctlscript.sh restart mysql

Can anyone tell the me difference between Ubuntu server and lamp stack or server?

I know that Ubuntu server is for server and LAMP is software for server which stands for Linux Apache MySQL PHP. My doubts are for when it comes to hosting a site. Is it required to install LAMP on Ubuntu server? Or does Ubuntu server has all the features of lamp?
You would normally install Ubuntu(or whatever distro) then all the components of lamp. The server distribution of Ubuntu doesn't include Apache, PHP, or MySQL by default. You can install them with
sudo apt install php5 libapache2-mod-php5 apache2 mysql-server
See this page for more details on the configuration.
https://www.howtoforge.com/ubuntu_lamp_for_newbies

Finding 'Nginx.conf'

I recently started using vagrant and Virtualbox to run my Wordpress website. Today I ran into a problem. I was trying to import a theme and this happened.
413 Request Entity Too Large --- nginx/1.6.2 (Ubuntu).
I think that I know how to solve this, but for that i need to have access to the nginx.conf file. How do I access this where do I find it?
I' m using a mac.
you would need to login into the VM - you can do vagrant ssh to do so.
Once on the VM, you would need to edit your nginx.conf file as sudo (nginx.conf file is generally located in the directory /usr/local/nginx/conf, /etc/nginx, or /usr/local/etc/nginx on your VM depending how the installation was done) so sudo vi nginx.conf from the correct directory and you can make the change.
make sure to restart nginx after you made the change sudo /etc/init.d/nginx restart from the VM or even restart the VM if you make many changed vagrant reload from the host and you'll be ok

Resources