You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MUSESDevGuide.tex
+83-5Lines changed: 83 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -148,7 +148,8 @@ \subsection{Preparing the database}
148
148
\item[\texttt{SHOW DATABASES;}] should list the databases, and also MUSES database.
149
149
\item[\texttt{USE muses;}]
150
150
\item[\texttt{SHOW TABLES;}] should list the tables inside MUSES database.
151
-
\item[\texttt{GRANT ALL ON muses.* TO 'muses'@'localhost';}] which gives permission to the MusesServer project to access the content in the MUSES database.
151
+
\item[\texttt{CREATE USER 'muses'@'\%' IDENTIFIED BY 'muses11';}] creates a remote user for MUSES.
152
+
\item[\texttt{GRANT ALL ON muses.* TO 'muses'@'\%';}] which gives permission to the MusesServer project to access the content in the MUSES database. Replace '\%' with localhost to make it only accessible from localhost.
152
153
\end{description}
153
154
154
155
Finally, go to Eclipse again, right-click on the MusesServer project, and then go to \textit{Run As > Maven clean}, as it was shown in Figure \ref{fig:RunAs}. In the console, you will see a ``BUILD SUCESS'', and then, repeat going to \textit{Run As > Maven install}. Check that there were no errors, specially this type of error: \texttt{\textit{Error calling Driver\#connect}}, which means that the code cannot connect to the database. Now, you can implement functionalities and test them locally by doing \textit{Run As > Maven install} or \textit{Run As > Maven test}.
@@ -237,9 +238,9 @@ \chapter{Creating and integrating new sensors}
237
238
\chapter{Installing MUSES}
238
239
\label{ch:installmuses}
239
240
240
-
Table \ref{tab:server_infrastructure} shows the hardware requirements to run MUSES server applications, the following sections will explain how to install and configure these requirements.
241
+
Table \ref{tab:server_infrastructure} shows the hardware requirements to run MUSES server applications. The following sections will explain how to install and configure these requirements but the database, which was explained in Section \ref{subsec:database}.
Section \ref{sec:eclipsetomcat} explained how to install the last version of Apache Tomcat server, because it was needed for developing purposes. Once you have followed the steps in that section, we continue configuring the server in order to finally have a working MUSES environment on our system.
268
269
269
-
But first of all, we have to install the Tomcat web application administrator by this command \cite{tomcatdocu:site}:
270
+
As said in that section, Tomcat configuration files are at \texttt{/etc/tomcat7} directory. Among the configuration files, \textit{server.xml} can be found. Also, Figure \ref{fig:serverconfig} shown the configuration of Apache Tomcat, which includes the listening port. The default listening port for Apache is 8080, but we see in the figure that we have configured it at port 8888. The file \textit{server.xml} offers the possibility of changing the default port:
By simply changing \textit{connector port} 8080 for 8888. Please note that you may have to open \textit{server.xml} under superuser rights.
282
+
283
+
Then, we have to install the Tomcat web application administrator by this command \cite{tomcatdocu:site}:
270
284
271
285
\begin{verbatim}
272
-
$ sudo apt-get install tomcat7
286
+
$ sudo apt-get install tomcat7-admin
287
+
\end{verbatim}
288
+
289
+
In order to add manager privileges, and to be able to use Tomcat web applications like \textit{host-manager} \cite{tomcatdocu:site}, we need to define a \textit{``manager-gui''} user in \textit{tomcat-users.xml} file. This file is also among the configuration files at \texttt{/etc/tomcat7}. Open this file under superuser rights and make sure to change it until it looks like:
290
+
291
+
\begin{verbatim}
292
+
<?xml version='1.0' encoding='utf-8'?>
293
+
<tomcat-users>
294
+
<role rolename="manager-gui"/>
295
+
<role rolename="manager"/>
296
+
<role rolename="admin-gui"/>
297
+
<role rolename="admin "/>
298
+
<user username="admin" password="admin"
299
+
roles="manager, manager-gui"/>
300
+
</tomcat-users>
301
+
\end{verbatim}
302
+
303
+
\subsection{SSL configuration Tomcat}
304
+
\label{subsec:ssltomcat}
305
+
306
+
MUSES is using HTTPS in order to make the communication encrypted, and secure. SSL encryption has to be enabled in Tomcat server configuration with an SSL certificate location, on the server machine. Back again in the Tomcat configuration folder, at \texttt{/etc/tomcat7}, the \textit{web.xml} file allows to configure HTTPS on tomcat.
307
+
308
+
This way, open the \textit{web.xml} file and add the following lines:
This will allow the MUSES servlet to listen for HTTPS connections. However, we also have to modify the file \textit{server.xml}, which is the same that have to be modified to change the listening port (see the beginning of this section). What we need now is to enable SSL authentication by adding:
323
+
324
+
\begin{verbatim}
325
+
<Connector
326
+
SSLEnabled="true"
327
+
ciphers="SSL_RSA_WITH_RC4_128_SHA"
328
+
clientAuth="false"
329
+
keystoreFile="/etc/tomcat7/keystore.jks"
330
+
keystorePass="MUSES11"
331
+
maxThreads="150"
332
+
port="8443"
333
+
protocol="HTTP/1.1"
334
+
scheme="https" secure="true" sslProtocol="TLS" />
335
+
\end{verbatim}
336
+
337
+
Finally, Apache Tomcat has to be restarted in order to successfully apply the changes. This is done by:
338
+
339
+
\begin{verbatim}
340
+
$ sudo service tomcat restart
341
+
\end{verbatim}
342
+
343
+
\section{Starting MUSES}
344
+
\label{sec:musestart}
345
+
346
+
To be able to start MUSES, the WAR file (Web Archive file) is required. The Tomcat 7.0 application server setup requires deploying the war file in the tomcat container. Follow below instructions.
347
+
348
+
Open a web browser and go to this link
349
+
\url{http://localhost:8080/manager/html}
350
+
It will ask for the user name and password. Enter the credentials which have been set during tomcat configuration\footnote{In our case, we used admin/admin at \textit{tomcat-users.xml}, but they can be changed.}, then it will open the manager page for tomcat. Now in section \textit{\textbf{WAR file to deploy}} click on \textit{Browse...} and select the war file, then click \textit{Deploy}.
351
+
After doing this the application is listed in the applications column. Now click on the application button to start the server.
0 commit comments