APMonitor Server for Linux

Main.APMonitorServerLinux History

Hide minor edits - Show changes to output

Deleted lines 22-23:
** Install PHP7
Deleted lines 23-26:

* Edit PHP5 ini file

 sudo gedit /etc/php5/apache2/php.ini
Changed lines 21-26 from:
* Install PHP5 ''or'' PHP7 with Apache Module

** Install PHP5

 sudo apt-get install php5 libapache2-mod-php5

to:
* Install PHP7 with Apache Module
Changed line 25 from:
 sudo apt-get install libapache2-mod-php
to:
 sudo apt-get install php7 libapache2-mod-php7.0
May 13, 2021, at 08:48 PM by 10.35.117.248 -
Deleted lines 96-102:
To run the apmonitor executable from a command line, add the following:

* Add to /home/{user}/.bashrc (edit file)

 export PATH="/var/www/html/bin:$PATH"
 export LD_LIBRARY_PATH="/var/www/html/lib:$LD_LIBRARY_PATH"
 source .bashrc    (or restart bash shell)
May 13, 2021, at 08:46 PM by 10.35.117.248 -
Changed lines 76-81 from:
 sudo cp -n apm_linux/lib/* /usr/lib/
to:

If shared libraries are part of the install (needed only for APMonitor binaries that include IPOPT), copy the ''apm'' folder to ''/usr/lib/'' and make the library folder discoverable with ''ldconfig''.

 sudo mv apm_linux/lib/apm /usr/lib/
 sudo echo "/usr/lib/apm" > /etc/ld.so.conf.d/apmonitor.conf
 sudo ldconfig
July 29, 2018, at 05:46 AM by 45.56.3.173 -
Deleted lines 54-57:
* Obtain APMonitor server files

 git https://github.com/APMonitor/apm_server

Added lines 67-70:
* Obtain APMonitor server files

 git clone https://github.com/APMonitor/apm_server.git

Changed lines 72-73 from:
to:
 
 cd apm_server
July 29, 2018, at 05:41 AM by 45.56.3.173 -
Changed lines 55-66 from:
* Download APMonitor server files (tar.gz)

 sudo wget
https://apmonitor.com/download/apmonitor_install.tar.gz

* Extract files

 sudo tar -xvf apmonitor_install.tar.gz

* Clean up

 sudo rm apmonitor_install.tar.gz

to:
* Obtain APMonitor server files

 git
https://github.com/APMonitor/apm_server
Changed line 73 from:
 sudo cp -n /var/www/html/bin/apmonitor /usr/bin/apmonitor
to:
 sudo cp -n apm_linux/bin/apmonitor /usr/bin/apmonitor
Changed line 75 from:
 sudo cp -n /var/www/html/lib/* /usr/lib/
to:
 sudo cp -n apm_linux/lib/* /usr/lib/
July 18, 2017, at 03:16 PM by 144.5.226.51 -
Added lines 74-77:

* Change web root directory to be owned by Apache group:user as www-data:www-data

 sudo chown -R www-data:www-data /var/www/html/*
July 18, 2017, at 03:12 PM by 144.5.226.51 -
Changed lines 39-42 from:
* Increase max execution time (requires sudo editing permission)
** max_execution_time = 100000000

* Restart Apache
to:
* Increase max execution time (requires sudo editing permission of php.ini)

max_execution_time = 100000000

* Save php.ini file and restart Apache server
July 18, 2017, at 03:11 PM by 144.5.226.51 -
Changed lines 51-53 from:
** cd /var/www/html
to:

cd /var/www/html
Changed lines 55-57 from:
** sudo wget https://apmonitor.com/download/apmonitor_install.tar.gz
to:

sudo wget https://apmonitor.com/download/apmonitor_install.tar.gz
Changed lines 59-61 from:
** sudo tar -xvf apmonitor_install.tar.gz
to:

sudo tar -xvf apmonitor_install.tar.gz
Changed lines 63-65 from:
** sudo rm apmonitor_install.tar.gz
to:

sudo rm apmonitor_install.tar.gz
Changed lines 67-69 from:
** sudo chmod -R www-data:www-data /var/www/html/*
to:

sudo chmod -R www-data:www-data /var/www/html/*
Changed lines 71-73 from:
** sudo chmod -R apache:apache /var/www/html/*
to:

sudo chmod -R apache:apache /var/www/html/*
Changed lines 75-78 from:
** sudo cp -n /var/www/html/bin/apmonitor /usr/bin/apmonitor
** sudo chmod 4775 /usr/bin/apmonitor
** sudo cp -n /var/www/html/lib/* /usr/lib/
to:

sudo cp -n /var/www/html/bin/apmonitor /usr/bin/apmonitor
 sudo chmod 4775 /usr/bin/apmonitor
 sudo cp -n /var/www/html/lib/* /usr/lib/
Changed lines 82-84 from:
** https://127.0.0.1/ip.php (Retrieve IP address, verifies that PHP is working)
** https
://127.0.0.1 (Local host homepage)
to:
The home page for the web server is now accessible at the following address:

 https:
//127.0.0.1

Open a web browser and type the following address to verify that PHP is working:

 https://127.0.0.1/ip.php

Changed lines 97-99 from:
** export PATH="/var/www/html/bin:$PATH"
** export LD_LIBRARY_PATH="/var/www/html/lib:$LD_LIBRARY_PATH"
* source .bashrc (or restart bash shell)
to:

export PATH="/var/www/html/bin:$PATH"
 export LD_LIBRARY_PATH="/var/www/html/lib:$LD_LIBRARY_PATH"
 source .bashrc    (or restart bash shell)
July 18, 2017, at 03:02 PM by 144.5.226.51 -
Changed lines 10-11 from:
** sudo apt-get update
** sudo apt-get install apache2
to:

sudo apt-get update
 sudo apt-get install apache2
Changed lines 15-17 from:
** sudo yum update
** sudo yum install apache2
to:

sudo yum update
 sudo yum install apache2
Changed lines 21-22 from:
* Install PHP5 or PHP7 with Apache Module
to:
* Install PHP5 ''or'' PHP7 with Apache Module

** Install PHP5

 sudo apt-get install php5 libapache2-mod-php5

Deleted lines 28-31:
  sudo apt-get install php5 libapache2-mod-php5

** Install PHP7

Changed lines 31-39 from:
* Edit /etc/php5/apache2/php.ini (PHP5) or /etc/php/7.0/apache2/php.ini (PHP7) to increase max execution time (requires sudo editing permission)
to:
* Edit PHP5 ini file

 sudo gedit
/etc/php5/apache2/php.ini

* Edit
PHP7 ini file

 sudo gedit /etc/php/7.0/apache2/php.ini

* Increase
max execution time (requires sudo editing permission)
Added line 41:
Changed lines 43-44 from:
** sudo apachectl restart
to:

 sudo apachectl restart
July 18, 2017, at 02:59 PM by 144.5.226.51 -
Changed lines 18-21 from:
* Install PHP with Apache Module
** sudo apt-get install php5 libapache2-mod-php5

* Edit /etc/
php5/apache2/php.ini to increase max execution time (requires sudo editing permission)
to:
* Install PHP5 or PHP7 with Apache Module

** Install PHP7

  sudo apt
-get install php5 libapache2-mod-php5 

** Install PHP7

 sudo apt-get install libapache2-mod-php

* Edit /etc/php5/apache2/php.ini (PHP5) or /etc/php/7.0/apache2/php.ini (PHP7)
to increase max execution time (requires sudo editing permission)
July 10, 2017, at 04:32 AM by 45.56.3.173 -
Changed line 21 from:
* Edit /etc/php/7.0/apache2/php.ini to increase max execution time (requires sudo editing permission)
to:
* Edit /etc/php5/apache2/php.ini to increase max execution time (requires sudo editing permission)
July 10, 2017, at 04:28 AM by 45.56.3.173 -
Changed line 19 from:
** sudo apt-get install php libapache2-mod-php
to:
** sudo apt-get install php5 libapache2-mod-php5
April 10, 2017, at 11:20 PM by 10.4.52.133 -
Changed lines 42-44 from:
* Put the binary and libraries in the PATH and LD_LIBRARY_PATH
** cp -n
/var/www/html/bin/apmonitor /usr/bin/apmonitor
** cp -n /var/www/html/lib/* /usr/lib/
to:
* Put the binary in the path and libraries in the library path
** sudo cp -n
/var/www/html/bin/apmonitor /usr/bin/apmonitor
** sudo chmod 4775 /usr/bin/apmonitor
** sudo
cp -n /var/www/html/lib/* /usr/lib/
April 10, 2017, at 11:19 PM by 10.4.52.133 -
Changed line 44 from:
** cp -n /var/www/html/lib/* /usr/lib/*
to:
** cp -n /var/www/html/lib/* /usr/lib/
April 10, 2017, at 11:18 PM by 10.4.52.133 -
Changed lines 42-43 from:
* Copy /var/www/html/bin/apmonitor to /usr/bin/apmonitor
* Copy /var/www/html/lib/* to
/usr/lib/*
to:
* Put the binary and libraries in the PATH and LD_LIBRARY_PATH
** cp -n /var/www/html/bin/apmonitor /usr/bin/apmonitor
** cp -n /var/www/html/lib/*
/usr/lib/*
April 10, 2017, at 11:16 PM by 10.4.52.133 -
Changed lines 42-43 from:
* Copy /var/www/html/bin/apmonitor to /usr/bin
* Copy /var/www/html/lib/* to /usr/lib
to:
* Copy /var/www/html/bin/apmonitor to /usr/bin/apmonitor
* Copy /var/www/html/lib/* to /usr/lib/*
April 10, 2017, at 11:13 PM by 10.4.52.133 -
Changed lines 42-43 from:
* Copy /var/www/html/bin/apmonitor to /usr/local/bin
* Copy /var/www/html/lib/* to /usr/local/lib
to:
* Copy /var/www/html/bin/apmonitor to /usr/bin
* Copy /var/www/html/lib/* to /usr/lib
April 10, 2017, at 11:08 PM by 10.4.52.133 -
Changed lines 38-42 from:
* Add directory to path in /home/{user}/.bashrc (edit file)
** export PATH="/var/
www/html/bin:$PATH"
** export LD_LIBRARY_PATH="
/var/www/html/lib:$LD_LIBRARY_PATH"
** source .bashrc (or restart bash shell)
to:
* Change directory permission for Ubuntu, Debian
** sudo chmod -R
www-data:www-data /var/www/html/*
* Change directory permission for Redhat, CentOS
** sudo chmod -R apache:apache /var/www/html/*
* Copy /var/www/html/bin/apmonitor to /usr/local/bin
* Copy /var/www/html/lib/* to /usr/local/lib

Added lines 53-59:

To run the apmonitor executable from a command line, add the following:

* Add to /home/{user}/.bashrc (edit file)
** export PATH="/var/www/html/bin:$PATH"
** export LD_LIBRARY_PATH="/var/www/html/lib:$LD_LIBRARY_PATH"
* source .bashrc (or restart bash shell)
April 10, 2017, at 10:03 PM by 10.4.52.133 -
Added line 40:
** export LD_LIBRARY_PATH="/var/www/html/lib:$LD_LIBRARY_PATH"
April 10, 2017, at 09:51 PM by 10.4.52.133 -
Changed line 35 from:
** tar -xvf apmonitor_install.tar.gz
to:
** sudo tar -xvf apmonitor_install.tar.gz
Changed lines 37-38 from:
** rm apmonitor_install.tar.gz
* Add directory to path in /home/{user}/.bashrc
to:
** sudo rm apmonitor_install.tar.gz
* Add directory to path in /home/{user}/.bashrc (edit file)
April 10, 2017, at 09:46 PM by 10.4.52.133 -
Added lines 38-40:
* Add directory to path in /home/{user}/.bashrc
** export PATH="/var/www/html/bin:$PATH"
** source .bashrc (or restart bash shell)
April 10, 2017, at 09:37 PM by 10.4.52.133 -
Changed lines 32-33 from:
* Download APMonitor server files (tar.gz) and extract archive
** curl
https://apmonitor.com/download/apmonitor_install.tar.gz | tar xvz
to:
* Download APMonitor server files (tar.gz)
** sudo wget https://apmonitor.com/download/apmonitor_install.tar.gz
* Extract files
**
tar -xvf apmonitor_install.tar.gz
* Clean up
** rm apmonitor_install.tar.gz
April 10, 2017, at 09:28 PM by 10.4.52.133 -
Changed line 33 from:
** curl https://apmonitor.com/download/apm_install.tar.gz | tar xvz
to:
** curl https://apmonitor.com/download/apmonitor_install.tar.gz | tar xvz
April 10, 2017, at 09:27 PM by 10.4.52.133 -
Changed line 33 from:
** curl https://apmonitor.com/download/apmonitor_install.tar.gz | tar xvz
to:
** curl https://apmonitor.com/download/apm_install.tar.gz | tar xvz
April 10, 2017, at 08:58 PM by 10.4.52.133 -
Deleted lines 26-27:

* [[|APMonitor Download for Linux (apmonitor_install.tar.gz)]]
April 10, 2017, at 08:58 PM by 10.4.52.133 -
Changed lines 28-29 from:
* [[https://apmonitor.com/download/apmonitor_install.tar.gz|APMonitor Download for Linux (apmonitor_install.tar.gz)]]
to:
* [[|APMonitor Download for Linux (apmonitor_install.tar.gz)]]
Changed lines 34-38 from:
* Extract file contents from apmonitor_install.tar.gz
** gunzip apmonitor_install.tar.gz
** tar -xf apmonitor_install.tar
* Copy all files to web server folder to /var/www/html/online/
* Test
installation with:
to:
* Download APMonitor server files (tar.gz) and extract archive
** curl https://apmonitor.com/download/apmonitor_install.tar.gz | tar xvz

The next step is
to verify installation. Navigate to a web-browser and visit the following addresses. The address 'https://127.0.0.1' or 'https://localhost' should work.
Added lines 41-43:

A number of test applications are also included in Python, MATLAB, and Julia. Point to the localhost server versus the public server for the server name.

April 10, 2017, at 08:53 PM by 10.4.52.133 -
Added lines 32-33:
* Change directory to web root folder
** cd /var/www/html
April 10, 2017, at 08:49 PM by 10.4.52.133 -
Changed lines 10-13 from:

  sudo apt-get update
  sudo apt-get install apache2
to:
** sudo apt-get update
** sudo apt-get install apache2
Changed lines 13-16 from:

  sudo yum update
  sudo yum install apache2
to:
** sudo yum update
** sudo yum install apache2
Changed lines 19-21 from:

  sudo apt-get install php libapache2-mod-php
to:
** sudo apt-get install php libapache2-mod-php
Changed lines 22-24 from:

  max_execution_time = 100000000
to:
** max_execution_time = 100000000
Changed lines 24-26 from:

  sudo apachectl restart
to:
** sudo apachectl restart
Changed lines 32-34 from:
* Unzip file contents from apmonitor_install.zip
to:
* Extract file contents from apmonitor_install.tar.gz
** gunzip apmonitor_install.tar.gz
** tar -xf apmonitor_install.tar
April 10, 2017, at 08:46 PM by 10.4.52.133 -
Added lines 1-44:
(:title APMonitor Server for Linux:)
(:keywords nonlinear, Python, MATLAB, model, predictive control, APMonitor, differential, algebraic, modeling language:)
(:description APMonitor Linux Server: A comprehensive modeling and nonlinear optimization solution with Python, MATLAB, or Julia scripting languages.:)

The APMonitor server is installed in three steps including (1) Apache web server installation, (2) PHP installation, and (3) APMonitor server files. Below are installation instructions for Linux. [[Main/APMonitorServer|Windows web server instructions]] are also available.

!!!! Step 1: Apache Web Server

* Update and Install Apache on Ubuntu, Debian Linux

  sudo apt-get update
  sudo apt-get install apache2

* Update and Install Apache on Redhat, CentOS Linux

  sudo yum update
  sudo yum install apache2

!!!! Step 2: PHP Installation and Configuration

* Install PHP with Apache Module

  sudo apt-get install php libapache2-mod-php

* Edit /etc/php/7.0/apache2/php.ini to increase max execution time (requires sudo editing permission)

  max_execution_time = 100000000

* Restart Apache

  sudo apachectl restart

!!!! Step 3: APMonitor Installation

* [[https://apmonitor.com/download/apmonitor_install.tar.gz|APMonitor Download for Linux (apmonitor_install.tar.gz)]]

Attach:apm_python.png Attach:apm_matlab.png The APMonitor server is designed for large-scale optimization and accesses solvers of constrained, unconstrained, continuous, and discrete problems. Problems in linear programming, quadratic programming, integer programming, nonlinear optimization, systems of dynamic nonlinear equations, and multi-objective optimization can be solved. The platform can find optimal solutions, perform trade-off analyses, balance multiple design alternatives, and incorporate optimization methods into external modeling and analysis software. It is freely available for academic and commercial use. It is the same service available on the public servers but does not require an Internet connection.

* Unzip file contents from apmonitor_install.zip
* Copy all files to web server folder to /var/www/html/online/
* Test installation with:
** https://127.0.0.1/ip.php (Retrieve IP address, verifies that PHP is working)
** https://127.0.0.1 (Local host homepage)
** Run scripts in test_* to test MATLAB, Python, or Julia with the APMonitor Optimization Suite